All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.ocl.util.Bag Maven / Gradle / Ivy

/**
 * 
 *
 * Copyright (c) 2006, 2007 IBM Corporation and others.
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   IBM - Initial API and implementation
 *
 * 
 *
 * $Id: Bag.java,v 1.1 2007/01/25 18:24:36 cdamus Exp $
 */
package org.eclipse.ocl.util;

import java.util.Collection;

/**
 * A bag is a collection that is non-unique and unordered.  It is, therefore,
 * like a set except that any element may occur multiple times.
 * 
 * @author Christian W. Damus (cdamus)
 */
public interface Bag extends Collection {
    /**
     * Queries how many times the specified object occurs in me.
     * If I do not contain the object, then the count is zero.
     * 
     * @param o an object
     * @return the number of times that it occurs in me
     */
    int count(Object o);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy