Class EJBHashSet

    • Constructor Detail

      • EJBHashSet

        public EJBHashSet​(PersistenceManager pm,
                          JDOEJB20Helper helper,
                          Collection pcs)
        Creates new instance of EJBHashSet 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.
        Specified by:
        add in interface Collection
        Specified by:
        add in interface Set
        Overrides:
        add in class HashSet
        Parameters:
        o - element to be added to this set.
        Returns:
        true if the set did not already contain the specified element.
        See Also:
        HashSet
      • remove

        public boolean remove​(Object o)
        Removes the given element from this set if it is present.
        Specified by:
        remove in interface Collection
        Specified by:
        remove in interface Set
        Overrides:
        remove in class HashSet
        Parameters:
        o - object to be removed from this set, if present.
        Returns:
        true if the set contained the specified element.
        See Also:
        HashSet
      • 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 interface Collection
        Specified by:
        removeAll in interface Set
        Overrides:
        removeAll in class AbstractSet
        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
      • clear

        public void clear()
        Removes all of the elements from this set.
        Specified by:
        clear in interface Collection
        Specified by:
        clear in interface Set
        Overrides:
        clear in class HashSet
        See Also:
        HashSet
      • size

        public int size()
        Returns the number of elements in this set (its cardinality).
        Specified by:
        size in interface Collection
        Specified by:
        size in interface Set
        Overrides:
        size in class HashSet
        Returns:
        the number of elements in this set (its cardinality).
      • isEmpty

        public boolean isEmpty()
        Returns true if this set contains no elements.
        Specified by:
        isEmpty in interface Collection
        Specified by:
        isEmpty in interface Set
        Overrides:
        isEmpty in class HashSet
        Returns:
        true if this set contains no elements.
      • contains

        public boolean contains​(Object o)
        Returns true if this set contains the specified element.
        Specified by:
        contains in interface Collection
        Specified by:
        contains in interface Set
        Overrides:
        contains in class HashSet
        Parameters:
        o - element whose presence in this set is to be tested.
        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 interface Collection
        Specified by:
        containsAll in interface Set
        Overrides:
        containsAll in class AbstractCollection
        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.
        Overrides:
        clone in class HashSet
        Returns:
        a shallow copy of this set.
      • 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.
      • invalidate

        public void invalidate()
        Marks this Set as invalid and releases all references.