Class EJBHashSet
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- java.util.HashSet
-
- com.sun.jdo.spi.persistence.support.ejb.cmp.EJBHashSet
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable
,Collection
,Set
public class EJBHashSet extends HashSet
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EJBHashSet(PersistenceManager pm, JDOEJB20Helper helper, Collection pcs)
Creates new instance ofEJBHashSet
for this parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(Object o)
Adds the specified element to this set if it is not already present.boolean
addAll(Collection c)
Adds all of the elements in the specified collection to this collectionvoid
clear()
Removes all of the elements from this set.Object
clone()
Returns a shallow copy of this HashSet instance: the elements themselves are not cloned.boolean
contains(Object o)
Returns true if this set contains the specified element.boolean
containsAll(Collection c)
Returns true if this collection contains all of the elements in the specified collection.HashSet
getSCOHashSet()
Returns set of the persistence-capable instances associated with this Set.void
invalidate()
Marks this Set as invalid and releases all references.boolean
isEmpty()
Returns true if this set contains no elements.Iterator
iterator()
Returns an iterator over the elements in this set.boolean
remove(Object o)
Removes the given element from this set if it is present.boolean
removeAll(Collection c)
Removes from this collection all of its elements that are contained in the specified collection (optional operation).boolean
retainAll(Collection c)
Retains only the elements in this collection that are contained in the specified collection (optional operation).void
setSCOHashSet(Collection coll)
Replace the set of the persistence-capable instances associated with this EJBHashSet.int
size()
Returns the number of elements in this set (its cardinality).-
Methods inherited from class java.util.HashSet
spliterator
-
Methods inherited from class java.util.AbstractSet
equals, hashCode
-
Methods inherited from class java.util.AbstractCollection
toArray, toArray, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
-
-
-
Constructor Detail
-
EJBHashSet
public EJBHashSet(PersistenceManager pm, JDOEJB20Helper helper, Collection pcs)
Creates new instance ofEJBHashSet
for this parameters.- Parameters:
pm
- the PersistenceManager associated with the calling bean.helper
- the JDOEJB20Helper instance.pcs
- a Collection of persistence-capable instances.
-
-
Method Detail
-
add
public boolean add(Object o)
Adds the specified element to this set if it is not already present.
-
addAll
public boolean addAll(Collection c)
Adds all of the elements in the specified collection to this collection- Specified by:
addAll
in interfaceCollection
- Specified by:
addAll
in interfaceSet
- Overrides:
addAll
in 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:
AbstractCollection
,HashSet
-
remove
public boolean remove(Object o)
Removes the given element from this set if it is present.
-
removeAll
public boolean removeAll(Collection c)
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:
removeAll
in interfaceCollection
- Specified by:
removeAll
in interfaceSet
- Overrides:
removeAll
in 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:
HashSet
,AbstractCollection
-
retainAll
public boolean retainAll(Collection c)
Retains only the elements in this collection that are contained in the specified collection (optional operation).- Specified by:
retainAll
in interfaceCollection
- Specified by:
retainAll
in interfaceSet
- Overrides:
retainAll
in 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:
HashSet
,AbstractCollection
-
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
public boolean contains(Object o)
Returns true if this set contains the specified element.
-
containsAll
public boolean containsAll(Collection c)
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:
containsAll
in interfaceCollection
- Specified by:
containsAll
in interfaceSet
- Overrides:
containsAll
in 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:
contains(Object)
-
clone
public Object clone()
Returns a shallow copy of this HashSet instance: the elements themselves are not cloned.
-
getSCOHashSet
public HashSet getSCOHashSet()
Returns set of the persistence-capable instances associated with this Set.- Returns:
- Set of the persistence-capable instances.
-
setSCOHashSet
public void setSCOHashSet(Collection coll)
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
public Iterator iterator()
Returns an iterator over the elements in this set. The elements are returned in no particular order.- Specified by:
iterator
in interfaceCollection
- Specified by:
iterator
in interfaceIterable
- Specified by:
iterator
in interfaceSet
- Overrides:
iterator
in classHashSet
- Returns:
- an Iterator over the elements in this set.
- See Also:
ConcurrentModificationException
-
invalidate
public void invalidate()
Marks this Set as invalid and releases all references.
-
-