|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractSet
java.util.HashSet
com.triactive.jdo.sco.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 SCOpublic java.util.Iterator iterator()
iterator in interface java.util.Collectionpublic int size()
size in interface java.util.Collectionpublic boolean isEmpty()
isEmpty in interface java.util.Collectionpublic boolean contains(java.lang.Object o)
contains in interface java.util.Collectionpublic boolean add(java.lang.Object o)
add in interface java.util.Collectionpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collectionpublic void clear()
clear in interface java.util.Collectionpublic void deletePersistentAll()
Deleteable
deletePersistentAll in interface Deleteablepublic boolean containsAll(java.util.Collection c)
containsAll in interface java.util.Collectionpublic boolean addAll(java.util.Collection c)
addAll in interface java.util.Collectionpublic boolean removeAll(java.util.Collection c)
removeAll in interface java.util.Collectionpublic boolean retainAll(java.util.Collection c)
retainAll in interface java.util.Collectionpublic java.lang.Object[] toArray()
toArray in interface java.util.Collectionpublic java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.Collectionpublic boolean equals(java.lang.Object o)
equals in interface java.util.Collectionpublic int hashCode()
hashCode in interface java.util.Collectionpublic java.lang.String toString()
protected 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 | ||||||||||