Methods Summary |
---|
public boolean | add(java.lang.Object o)Adds the specified element to this set if it is not already
present.
logger.finest("---EJBHashSet.add---"); // NOI18N
assertIsValid();
assertInTransaction();
helper.assertInstanceOfLocalInterfaceImpl(o);
Object pc = helper.convertEJBLocalObjectToPC((EJBLocalObject) o, pm, true);
return pcSet.add(pc);
|
public boolean | addAll(java.util.Collection c)Adds all of the elements in the specified collection to this collection
logger.finest("---EJBHashSet.addAll---"); // NOI18N
assertIsValid();
assertInTransaction();
assertInstancesOfLocalInterfaceImpl(c);
return pcSet.addAll(helper.convertCollectionEJBLocalObjectToPC(c, pm, true));
|
private void | assertInTransaction()Verifies that persistence manager is not closed and
the current transaction is active.
if (pm.isClosed() || !tx.isActive()) {
invalidate();
throw new IllegalStateException(); // RESOLVE Exception text.
}
|
private void | assertInstancesOfLocalInterfaceImpl(java.util.Collection c)Verifies that elements of this Collection are of the expected type.
for (Iterator it = c.iterator(); it.hasNext();)
helper.assertInstanceOfLocalInterfaceImpl(it.next());
|
private void | assertIsValid()Verifies that this Set is not marked as invalid.
if (!valid)
throw new IllegalStateException(); // RESOLVE Exception text.
|
public void | clear()Removes all of the elements from this set.
logger.finest("---EJBHashSet.clear---"); // NOI18N
assertIsValid();
assertInTransaction();
pcSet.clear();
|
public java.lang.Object | clone()Returns a shallow copy of this HashSet instance: the elements
themselves are not cloned.
logger.finest("---EJBHashSet.clone---"); // NOI18N
EJBHashSet newSet = (EJBHashSet)super.clone();
newSet.pcSet = (HashSet)pcSet.clone();
return newSet;
|
public boolean | contains(java.lang.Object o)Returns true if this set contains the specified element.
logger.finest("---EJBHashSet.contains---"); // NOI18N
assertIsValid();
assertInTransaction();
helper.assertInstanceOfLocalInterfaceImpl(o);
EJBLocalObject lo = (EJBLocalObject) o;
return pcSet.contains(helper.convertEJBLocalObjectToPC(lo, pm, true));
|
public boolean | containsAll(java.util.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.
logger.finest("---EJBHashSet.containsAll---"); // NOI18N
assertIsValid();
assertInTransaction();
assertInstancesOfLocalInterfaceImpl(c);
return pcSet.containsAll(helper.convertCollectionEJBLocalObjectToPC(c, pm, true));
|
public java.util.HashSet | getSCOHashSet()Returns set of the persistence-capable instances associated
with this Set.
assertIsValid();
assertInTransaction();
return (pcSet != null) ? (HashSet)pcSet.clone() : null;
|
public void | invalidate()Marks this Set as invalid and releases all references.
valid = false;
pm = null;
tx = null;
helper = null;
pcSet = null;
|
public boolean | isEmpty()Returns true if this set contains no elements.
logger.finest("---EJBHashSet.isEmpty---"); // NOI18N
assertIsValid();
assertInTransaction();
return pcSet.isEmpty();
|
public java.util.Iterator | iterator()Returns an iterator over the elements in this set. The elements
are returned in no particular order.
assertIsValid();
assertInTransaction();
return new EJBHashIterator();
|
public boolean | remove(java.lang.Object o)Removes the given element from this set if it is present.
logger.finest("---EJBHashSet.remove---"); // NOI18N
assertIsValid();
assertInTransaction();
helper.assertInstanceOfLocalInterfaceImpl(o);
EJBLocalObject lo = (EJBLocalObject) o;
return pcSet.remove(helper.convertEJBLocalObjectToPC(lo, pm, true));
|
public boolean | removeAll(java.util.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).
logger.finest("---EJBHashSet.removeAll---"); // NOI18N
assertIsValid();
assertInTransaction();
assertInstancesOfLocalInterfaceImpl(c);
return pcSet.removeAll(helper.convertCollectionEJBLocalObjectToPC(c, pm, true));
|
public boolean | retainAll(java.util.Collection c)Retains only the elements in this collection that are contained in the
specified collection (optional operation).
logger.finest("---EJBHashSet.retainAll---"); // NOI18N
assertIsValid();
assertInTransaction();
assertInstancesOfLocalInterfaceImpl(c);
return pcSet.retainAll(helper.convertCollectionEJBLocalObjectToPC(c, pm, true));
|
public void | setSCOHashSet(java.util.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.
if (coll instanceof java.util.HashSet)
pcSet = (java.util.HashSet)coll;
else
pcSet = new java.util.HashSet(coll);
|
public int | size()Returns the number of elements in this set (its cardinality).
logger.finest("---EJBHashSet.size---"); // NOI18N
assertIsValid();
assertInTransaction();
return pcSet.size();
|