|
|||||||||||
| 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
org.apache.jdo.impl.sco.HashSet
A mutable 2nd class object that represents HashSet.
HashSet,
Serialized Form| Field Summary | |
private static java.lang.String |
_HashSet
|
private java.util.HashSet |
added
|
private boolean |
allowNulls
|
private java.lang.Class |
elementType
|
private int |
fieldNumber
|
private java.lang.Object[] |
frozenElements
|
private static org.apache.jdo.util.I18NHelper |
msg
I18N message handler |
private StateManagerInternal |
owner
|
private java.util.HashSet |
removed
|
| Fields inherited from class java.util.HashSet |
|
| Constructor Summary | |
HashSet(java.lang.Class elementType,
boolean allowNulls)
Creates a new empty HashSet object. |
|
HashSet(java.lang.Class elementType,
boolean allowNulls,
int initialCapacity)
Creates a new empty HashSet object that has
the specified initial capacity. |
|
HashSet(java.lang.Class elementType,
boolean allowNulls,
int initialCapacity,
float loadFactor)
Creates a new empty HashSet object that has
the specified initial capacity.. |
|
| Method Summary | |
boolean |
add(java.lang.Object o)
Adds the specified element to this set if it is not already present. |
boolean |
addAll(java.util.Collection c)
Adds all of the elements in the specified collection to this collection |
void |
addAllInternal(java.util.Collection c)
Adds objects of the given Collection to this Collection without recording the event. |
void |
addInternal(java.lang.Object o)
Adds object to the Collection without recording the event. |
boolean |
allowNulls()
Returns whether nulls are permitted as elements. |
void |
clear()
Removes all of the elements from this set. |
void |
clearInternal()
Clears Collection without recording the event. |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
boolean |
contains(java.lang.Object o)
|
boolean |
containsAll(java.util.Collection c)
|
java.util.Iterator |
eitherIterator()
Create an iterator regardless whether the collection is frozen. |
boolean |
equals(java.lang.Object o)
|
java.util.Iterator |
frozenIterator()
Create a new iterator over the frozen elements without thawing. |
java.util.Collection |
getAdded()
Returns the Collection of added elements |
java.lang.Class |
getElementType()
Returns the element type assignment compatible with all added elements of this collection. |
java.lang.String |
getFieldName()
Returns the field name |
private java.lang.Object[] |
getFrozen()
Returns the frozen contents of this Collection, if this Collection is implicitly user-orderable. |
java.lang.Object |
getOwner()
Returns the owner object of the SCO instance |
java.util.Collection |
getRemoved()
Returns the Collection of removed elements |
int |
hashCode()
|
boolean |
isEmpty()
|
private boolean |
isFrozen()
Returns the frozen state of this set. |
java.util.Iterator |
iterator()
|
private void |
makeDirty()
Notify StateManager to mark field as dirty. |
boolean |
remove(java.lang.Object o)
Removes the given element from this set if it is present. |
boolean |
removeAll(java.util.Collection c)
Removes from this collection all of its elements that are contained in the specified collection (optional operation). |
void |
removeInternal(java.lang.Object o)
Removes element from the Collection without recording the event. |
void |
reset()
Resets removed and added lists after flush |
boolean |
retainAll(java.util.Collection c)
Retains only the elements in this collection that are contained in the specified collection (optional operation). |
void |
setFrozen(java.lang.Object[] elements)
Set the contents of this Collection from the frozen elements, if this Collection is implicitly user-orderable. |
void |
setOwner(java.lang.Object owner,
int fieldNumber)
Sets the owner and field number. |
int |
size()
|
private void |
thaw()
Thaw the frozen elements of this collection. |
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
|
java.lang.String |
toString()
|
private void |
trackUpdates(boolean modified)
Notify StateManager to process the changes. |
void |
unsetOwner(java.lang.Object owner,
int fieldNumber)
Nullifies references to the owner Object iff the passed in owner and fieldNumber match. |
| Methods inherited from class java.util.HashSet |
|
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
private transient StateManagerInternal owner
private transient int fieldNumber
private transient java.lang.Class elementType
private transient boolean allowNulls
private transient java.util.HashSet added
private transient java.util.HashSet removed
private transient java.lang.Object[] frozenElements
private static final org.apache.jdo.util.I18NHelper msg
private static final java.lang.String _HashSet
| Constructor Detail |
public HashSet(java.lang.Class elementType,
boolean allowNulls)
HashSet object.
elementType - the element types allowedallowNulls - true if nulls are allowedHashSet
public HashSet(java.lang.Class elementType,
boolean allowNulls,
int initialCapacity)
HashSet object that has
the specified initial capacity.
elementType - the element types allowedallowNulls - true if nulls are allowedinitialCapacity - the initial capacity of the hash map.
java.lang.IllegalArgumentException - if the initial capacity is less
than zero.HashSet
public HashSet(java.lang.Class elementType,
boolean allowNulls,
int initialCapacity,
float loadFactor)
HashSet object that has
the specified initial capacity..
elementType - the element types allowedallowNulls - true if nulls are allowedinitialCapacity - the initial capacity of the hash map.loadFactor - the load factor of the hash map.
java.lang.IllegalArgumentException - if the initial capacity is less
than zero.HashSet| Method Detail |
public boolean add(java.lang.Object o)
add in interface java.util.Collectiono - element to be added to this set.
HashSetpublic boolean addAll(java.util.Collection c)
addAll in interface java.util.Collectionc - collection whose elements are to be added to this collection.
java.lang.UnsupportedOperationException - if the addAll method is
not supported by this collection.AbstractCollection,
HashSetpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collectiono - object to be removed from this set, if present.
HashSetpublic boolean removeAll(java.util.Collection c)
Processes each element remove internally not to have call backs into #remove(Object).
removeAll in interface java.util.Collectionc - elements to be removed from this collection.
java.lang.UnsupportedOperationException - removeAll is not supported
by this collection.HashSet,
AbstractCollectionpublic boolean retainAll(java.util.Collection c)
retainAll in interface java.util.Collectionjava.lang.UnsupportedOperationException - if the retainAll method
is not supported by this collection.HashSet,
AbstractCollectionpublic void clear()
clear in interface java.util.CollectionHashSetpublic 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 void reset()
SCOCollection
reset in interface SCOCollectionSCOCollection.reset()public void addInternal(java.lang.Object o)
SCOCollection
addInternal in interface SCOCollectionSCOCollection.addInternal(Object o)public void addAllInternal(java.util.Collection c)
SCOCollection
addAllInternal in interface SCOCollectionSCOCollection.addAllInternal(Collection c)public java.util.Collection getAdded()
SCOCollection
getAdded in interface SCOCollectionSCOCollection.getAdded()public java.util.Collection getRemoved()
SCOCollection
getRemoved in interface SCOCollectionSCOCollection.getRemoved()public void clearInternal()
SCOCollection
clearInternal in interface SCOCollectionSCOCollection.clearInternal()public void removeInternal(java.lang.Object o)
SCOCollection
removeInternal in interface SCOCollectionSCOCollection.removeInternal(Object o)
public void unsetOwner(java.lang.Object owner,
int fieldNumber)
SCO
unsetOwner in interface SCOowner - the existing owner object.fieldNumber - the existing number of the field.SCO.unsetOwner(Object owner, int fieldNumber)
public void setOwner(java.lang.Object owner,
int fieldNumber)
SCO
setOwner in interface SCOowner - the owner object.fieldNumber - the number of the field associated with this instance.(Object owner, int fieldNumber)public java.lang.Object getOwner()
SCO
getOwner in interface SCOSCO.getOwner()public java.lang.String getFieldName()
SCO
getFieldName in interface SCOSCO.getFieldName()private void makeDirty()
private void trackUpdates(boolean modified)
public java.lang.Class getElementType()
SCOCollection
getElementType in interface SCOCollection{public boolean allowNulls()
SCOCollection
allowNulls in interface SCOCollection{public boolean contains(java.lang.Object o)
contains in interface java.util.Collectionpublic boolean containsAll(java.util.Collection c)
containsAll in interface java.util.Collectionpublic boolean isEmpty()
isEmpty in interface java.util.Collectionpublic java.util.Iterator iterator()
iterator in interface java.util.Collectionpublic int size()
size 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()
public java.lang.Object[] toArray()
toArray in interface java.util.Collectionpublic java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.Collectionprivate boolean isFrozen()
private java.lang.Object[] getFrozen()
public void setFrozen(java.lang.Object[] elements)
setFrozen in interface SCOCollectionelements - the frozen elements of this set.private void thaw()
public java.util.Iterator frozenIterator()
frozenIterator in interface SCOCollectionpublic java.util.Iterator eitherIterator()
eitherIterator in interface SCOCollection
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||