|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet
com.triactive.jdo.sco.HashSet
public class HashSet
A mutable second-class HashSet object.
SCO fields declared as type java.util.Collection, java.util.Set, or java.util.HashSet are populated with objects of this type whenever the owning object is actively being managed by a state manager.
While an SCO HashSet is owned it is considered either transient or persistent according to whether its owner is in a transient or persistent state.
While the owner/set is transient:
In addition to the above, while the owner/set is persistent:
An instance of this class is always associated with a backing store, although the store is only used when the set is persistent.
The set disconnects from its owner when unsetOwner() is called.
This occurs automatically in a variety of scenarios, such as when the object
is cloned or when its owning object (the one whose Set field refers to it)
transitions to a unmanaged state.
When a disconnect occurs the object subsequently behaves as a normal HashSet.
Subsequent changes affect only the memory contents.
Once disconnected from its owner an instance can never be reconnected.
| Constructor Summary | |
|---|---|
HashSet(java.lang.Object owner,
java.lang.String fieldName,
PersistentSet backing)
Constructs an SCO HashSet representing an existing persistent set. |
|
HashSet(java.lang.Object owner,
java.lang.String fieldName,
PersistentSet backing,
java.util.Collection value)
Constructs an SCO HashSet having the specified initial contents. |
|
| Method Summary | |
|---|---|
boolean |
add(java.lang.Object o)
|
boolean |
addAll(java.util.Collection c)
|
boolean |
allowsNulls()
Indicates whether or not this collection allows null elements. |
boolean |
alreadyDistinct()
Indicates whether or not the candidate collection contains a set of distinct (unique) objects. |
void |
applyUpdates()
Called to indicate that the owning object is being made persistent, or that the persistent state of this field is being updated. |
void |
clear()
|
java.lang.Object |
clone()
Creates and returns a copy of this object. |
boolean |
contains(java.lang.Object o)
|
boolean |
containsAll(java.util.Collection c)
|
void |
deletePersistentAll()
Deletes all instances in this collection from the data store. |
boolean |
equals(java.lang.Object o)
|
java.lang.Class |
getCandidateClass()
Returns the default class of candidate objects contained in this queryable collection. |
java.lang.Class |
getElementType()
Returns the type of elements in this collection. |
java.lang.String |
getFieldName()
Returns the field name in the owner object. |
java.lang.Object |
getOwner()
Returns the owner object of the SCO instance. |
int |
hashCode()
|
boolean |
isEmpty()
|
java.util.Iterator |
iterator()
|
void |
makeDirty()
Marks this object dirty. |
SqlExpression |
newQueryStatement(java.lang.Class candidateClass)
Creates a prototypical query statement over the underlying collection, pre-filtered to include only objects of the specified class. |
boolean |
remove(java.lang.Object o)
|
boolean |
removeAll(java.util.Collection c)
|
boolean |
retainAll(java.util.Collection c)
|
int |
size()
|
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
|
java.lang.String |
toString()
|
void |
unsetOwner()
Disconnects this object from its owner. |
protected java.lang.Object |
writeReplace()
Replaces the object to be serialized with a java.util.HashSet object. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HashSet(java.lang.Object owner,
java.lang.String fieldName,
PersistentSet backing)
owner - The object that owns this second-class object.fieldName - The fieldName in the owning object.backing - The backing store for this set.
public HashSet(java.lang.Object owner,
java.lang.String fieldName,
PersistentSet backing,
java.util.Collection value)
If the owning object is already persistent it is assumed its field is being assigned an entirely new value. The existing set contents are cleared in the data store and the new contents are added.
owner - The object that owns this second-class object.fieldName - The fieldName in the owning object.backing - The backing store for this set.value - The initial contents of the set.| Method Detail |
|---|
public java.lang.Object getOwner()
SCO
getOwner in interface SCOnull if currently unowned.public java.lang.String getFieldName()
SCO
getFieldName in interface SCOnull if currently unowned.public java.lang.Class getElementType()
SCOCollection
getElementType in interface SCOCollectionpublic boolean allowsNulls()
SCOCollection
allowsNulls in interface SCOCollectiontrue if null elements are allowed,
false otherwise.public void makeDirty()
SCO
makeDirty in interface SCOpublic void applyUpdates()
SCO
applyUpdates in interface SCOpublic void unsetOwner()
SCO
unsetOwner in interface SCOpublic java.lang.Class getCandidateClass()
Queryable
getCandidateClass in interface Queryablepublic boolean alreadyDistinct()
Queryable
alreadyDistinct in interface Queryabletrue if the candidate objects are all unique,
false if there may be duplicates.public SqlExpression newQueryStatement(java.lang.Class candidateClass)
Queryable
newQueryStatement in interface QueryablecandidateClass - The class of objects to query over.
public java.lang.Object clone()
Mutable second-class Objects are required to provide a public clone method in order to allow for copying PersistenceCapable objects. In contrast to Object.clone(), this method must not throw a CloneNotSupportedException.
clone in interface SCOclone in class java.util.HashSetpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Setiterator in class java.util.HashSetpublic int size()
size in interface java.util.Collectionsize in interface java.util.Setsize in class java.util.HashSetpublic boolean isEmpty()
isEmpty in interface java.util.CollectionisEmpty in interface java.util.SetisEmpty in class java.util.HashSetpublic boolean contains(java.lang.Object o)
contains in interface java.util.Collectioncontains in interface java.util.Setcontains in class java.util.HashSetpublic boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Setadd in class java.util.HashSetpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collectionremove in interface java.util.Setremove in class java.util.HashSetpublic void clear()
clear in interface java.util.Collectionclear in interface java.util.Setclear in class java.util.HashSetpublic void deletePersistentAll()
Deleteable
deletePersistentAll in interface Deleteablepublic boolean containsAll(java.util.Collection c)
containsAll in interface java.util.CollectioncontainsAll in interface java.util.SetcontainsAll in class java.util.AbstractCollectionpublic boolean addAll(java.util.Collection c)
addAll in interface java.util.CollectionaddAll in interface java.util.SetaddAll in class java.util.AbstractCollectionpublic boolean removeAll(java.util.Collection c)
removeAll in interface java.util.CollectionremoveAll in interface java.util.SetremoveAll in class java.util.AbstractSetpublic boolean retainAll(java.util.Collection c)
retainAll in interface java.util.CollectionretainAll in interface java.util.SetretainAll in class java.util.AbstractCollectionpublic java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.SettoArray in class java.util.AbstractCollectionpublic java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.CollectiontoArray in interface java.util.SettoArray in class java.util.AbstractCollectionpublic boolean equals(java.lang.Object o)
equals in interface java.util.Collectionequals in interface java.util.Setequals in class java.util.AbstractSetpublic int hashCode()
hashCode in interface java.util.CollectionhashCode in interface java.util.SethashCode in class java.util.AbstractSetpublic java.lang.String toString()
toString in class java.util.AbstractCollectionprotected java.lang.Object writeReplace()
HashSet to be serialized instead of this object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||