Class EJBHashSet
java.lang.Object
java.util.AbstractCollection
java.util.AbstractSet
java.util.HashSet
com.sun.jdo.spi.persistence.support.ejb.cmp.EJBHashSet
- All Implemented Interfaces:
Serializable,Cloneable,Iterable,Collection,Set
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEJBHashSet(com.sun.jdo.api.persistence.support.PersistenceManager pm, com.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB20Helper helper, Collection pcs) Creates new instance ofEJBHashSetfor this parameters. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds the specified element to this set if it is not already present.booleanaddAll(Collection c) Adds all of the elements in the specified collection to this collectionvoidclear()Removes all of the elements from this set.clone()Returns a shallow copy of this HashSet instance: the elements themselves are not cloned.booleanReturns true if this set contains the specified element.booleanReturns true if this collection contains all of the elements in the specified collection.Returns set of the persistence-capable instances associated with this Set.voidMarks this Set as invalid and releases all references.booleanisEmpty()Returns true if this set contains no elements.iterator()Returns an iterator over the elements in this set.booleanRemoves the given element from this set if it is present.booleanRemoves from this collection all of its elements that are contained in the specified collection (optional operation).booleanRetains only the elements in this collection that are contained in the specified collection (optional operation).voidsetSCOHashSet(Collection coll) Replace the set of the persistence-capable instances associated with this EJBHashSet.intsize()Returns the number of elements in this set (its cardinality).Methods inherited from class java.util.HashSet
newHashSet, spliterator, toArray, toArrayMethods inherited from class java.util.AbstractSet
equals, hashCodeMethods inherited from class java.util.AbstractCollection
toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Constructor Details
-
EJBHashSet
public EJBHashSet(com.sun.jdo.api.persistence.support.PersistenceManager pm, com.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB20Helper helper, Collection pcs) Creates new instance ofEJBHashSetfor this parameters.- Parameters:
pm- the PersistenceManager associated with the calling bean.helper- the JDOEJB20Helper instance.pcs- a Collection of persistence-capable instances.
-
-
Method Details
-
add
Adds the specified element to this set if it is not already present. -
addAll
Adds all of the elements in the specified collection to this collection- Specified by:
addAllin interfaceCollection- Specified by:
addAllin interfaceSet- Overrides:
addAllin classAbstractCollection- Parameters:
c- collection whose elements are to be added to this collection.- Returns:
- true if this collection changed as a result of the call.
- Throws:
UnsupportedOperationException- if the addAll method is not supported by this collection.- See Also:
-
remove
Removes the given element from this set if it is present. -
removeAll
Removes from this collection all of its elements that are contained in the specified collection (optional operation).Processes each element remove internally not to have call backs into #remove(Object).
- Specified by:
removeAllin interfaceCollection- Specified by:
removeAllin interfaceSet- Overrides:
removeAllin classAbstractSet- Parameters:
c- elements to be removed from this collection.- Returns:
- true if this collection changed as a result of the call.
- Throws:
UnsupportedOperationException- removeAll is not supported by this collection.- See Also:
-
retainAll
Retains only the elements in this collection that are contained in the specified collection (optional operation).- Specified by:
retainAllin interfaceCollection- Specified by:
retainAllin interfaceSet- Overrides:
retainAllin classAbstractCollection- Returns:
- true if this collection changed as a result of the call.
- Throws:
UnsupportedOperationException- if the retainAll method is not supported by this collection.- See Also:
-
clear
public void clear()Removes all of the elements from this set. -
size
public int size()Returns the number of elements in this set (its cardinality). -
isEmpty
public boolean isEmpty()Returns true if this set contains no elements. -
contains
Returns true if this set contains the specified element. -
containsAll
Returns true if this collection contains all of the elements in the specified collection.This implementation iterates over the specified collection, checking each element returned by the iterator in turn to see if it's contained in this collection. If all elements are so contained true is returned, otherwise false.
- Specified by:
containsAllin interfaceCollection- Specified by:
containsAllin interfaceSet- Overrides:
containsAllin classAbstractCollection- Parameters:
c- collection to be checked for containment in this collection.- Returns:
- true if this collection contains all of the elements in the specified collection.
- See Also:
-
clone
Returns a shallow copy of this HashSet instance: the elements themselves are not cloned. -
getSCOHashSet
Returns set of the persistence-capable instances associated with this Set.- Returns:
- Set of the persistence-capable instances.
-
setSCOHashSet
Replace the set of the persistence-capable instances associated with this EJBHashSet. There is no need to check transaction as it has already been checked in this case. -
iterator
Returns an iterator over the elements in this set. The elements are returned in no particular order. -
invalidate
public void invalidate()Marks this Set as invalid and releases all references.
-