/* * This file is part of rasdaman community. * * Rasdaman community is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Rasdaman community is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with rasdaman community. If not, see . * * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / rasdaman GmbH. * * For more information please see * or contact Peter Baumann via . */ package org.odmg; /** * This interface defines the operations associated with an ODMG bag collection. * All of the operations defined by the JavaSoft Collection * interface are supported by an ODMG implementation of DBag, * the exception UnsupportedOperationException is not thrown when a * call is made to any of the Collection methods. * @author David Jordan (as Java Editor of the Object Data Management Group) * @version ODMG 3.0 */ // * @see java.lang.UnsupportedOperationException public interface DBag extends DCollection { /** * A new DBag instance is created that is the union of this object * and otherBag. * This method is similar to the addAll method in Collection, * except that this method creates a new collection and addAll * modifies the object to contain the result. * @param otherBag The other bag to use in the union operation. * @return A DBag instance that contains the union of this object * and otherBag. */ // * @see com.sun.java.util.collections.Collection#addAll public DBag union(DBag otherBag); /** * A new DBag instance is created that contains the intersection of * this object and the DBag referenced by otherBag. * This method is similar to the retainAll method in Collection, * except that this method creates a new collection and retainAll * modifies the object to contain the result. * @param otherBag The other bag to use in creating the intersection. * @return A DBag instance that contains the intersection of this * object and otherBag. */ // @see com.sun.java.util.collections.Collection#retainAll public DBag intersection(DBag otherBag); /** * A new DBag instance is created that contains the difference of * this object and the DBag instance referenced by otherBag. * This method is similar to the removeAll method in Collection, * except that this method creates a new collection and removeAll * modifies the object to contain the result. * @param otherBag The other bag to use in creating the difference. * @return A DBag instance that contains the elements of this object * minus the elements in otherBag. */ // * @see com.sun.java.util.collections.Collection#removeAll public DBag difference(DBag otherBag); /** * This method returns the number of occurrences of the object obj * in the DBag collection. * @param obj The value that may have elements in the collection. * @return The number of occurrences of obj in this collection. */ public int occurrences(Object obj); }