public class HashSet extends HashSet implements SCOCollection
HashSet,
Serialized Form| Constructor and Description |
|---|
HashSet(Object owner,
String fieldName,
Class elementType,
boolean allowNulls)
Creates a new empty
HashSet object. |
HashSet(Object owner,
String fieldName,
Class elementType,
boolean allowNulls,
int initialCapacity)
Creates a new empty
HashSet object that has
the specified initial capacity.Assigns owning object and field name. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Object o)
Adds the specified element to this set if it is not already
present.
|
boolean |
addAll(Collection c)
Adds all of the elements in the specified collection to this collection
|
void |
addAllInternal(Collection c)
Adds a Collection to the list without recording changes if the HashSet is
not deferred.
|
void |
addInternal(Object o)
Adds an object to the list without recording changes if the HashSet is
not deferred.
|
void |
addToBaseCollection(Object o)
Adds an object to the list without recording changes.
|
void |
applyDeferredUpdates(Collection c)
If the HashSet is deferred, we first initialize the internal collection
with c and they apply any deferred updates specified by the added and
removed lists.
|
void |
applyUpdates(StateManager sm,
boolean modified)
Apply changes (can be a no-op)
|
void |
clear()
Removes all of the elements from this set.
|
void |
clearInternal()
Clears Collection without notifing the owner
|
Object |
clone()
Creates and returns a copy of this object.
|
Object |
cloneInternal()
Creates and returns a copy of this object without resetting the owner and field value.
|
Collection |
getAdded()
Returns added collection
|
String |
getFieldName()
Returns the field name
|
Object |
getOwner()
Returns the owner object of the SCO instance
|
Collection |
getRemoved()
Returns removed collection
|
boolean |
isDeferred()
Return true is this HashSet is deferred, false otherwise.
|
Iterator |
iterator()
Returns an iterator over the elements in this set.
|
StateManager |
makeDirty()
Marks object dirty
|
void |
markDeferred()
Mark this HashSet as deferred.
|
boolean |
remove(Object o)
Removes the given element from this set if it is present.
|
boolean |
removeAll(Collection c)
Removes from this collection all of its elements that are contained in
the specified collection (optional operation).
|
void |
removeAllInternal(Collection c)
Removes objects of the given Collection from this Collection without recording
the event.
|
void |
removeInternal(Object o)
Removes an element without notifing the owner
|
void |
reset()
Cleans removed and added lists
|
boolean |
retainAll(Collection c)
Retains only the elements in this collection that are contained in the
specified collection (optional operation).
|
void |
setOwner(Object owner,
String fieldName,
Class elementType)
Set the owner if this instance is not owned.
|
void |
unsetOwner()
Nullifies references to the owner Object and Field
|
contains, isEmpty, size, spliteratorequals, hashCodecontainsAll, toArray, toArray, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcontains, containsAll, equals, hashCode, isEmpty, parallelStream, removeIf, size, spliterator, stream, toArray, toArraypublic HashSet(Object owner, String fieldName, Class elementType, boolean allowNulls)
HashSet object.
Assigns owning object and field name.owner - the owning objectfieldName - the owning field nameelementType - the element types allowedallowNulls - true if nulls are allowedpublic HashSet(Object owner, String fieldName, Class elementType, boolean allowNulls, int initialCapacity)
HashSet object that has
the specified initial capacity.Assigns owning object and field name.owner - the owning objectfieldName - the owning field nameelementType - the element types allowedallowNulls - true if nulls are allowedinitialCapacity - the initial capacity of the hash map.IllegalArgumentException - if the initial capacity is less
than zero.HashSetpublic boolean add(Object o)
public boolean addAll(Collection c)
addAll in interface CollectionaddAll in interface SetaddAll in class AbstractCollectionc - collection whose elements are to be added to this collection.UnsupportedOperationException - if the addAll method is
not supported by this collection.AbstractCollection,
HashSetpublic boolean remove(Object o)
public boolean removeAll(Collection c)
removeAll in interface CollectionremoveAll in interface SetremoveAll in class AbstractSetc - elements to be removed from this collection.UnsupportedOperationException - removeAll is not supported
by this collection.HashSet,
AbstractCollectionpublic boolean retainAll(Collection c)
retainAll in interface CollectionretainAll in interface SetretainAll in class AbstractCollectionUnsupportedOperationException - if the retainAll method
is not supported by this collection.HashSet,
AbstractCollectionpublic void clear()
public 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.
public Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface Setiterator in class HashSetConcurrentModificationExceptionpublic Object cloneInternal()
cloneInternal in interface SCOpublic void reset()
reset in interface SCOCollectionpublic void markDeferred()
markDeferred in interface SCOCollectionpublic boolean isDeferred()
isDeferred in interface SCOCollectionpublic void applyDeferredUpdates(Collection c)
applyDeferredUpdates in interface SCOCollectionpublic void addInternal(Object o)
addInternal in interface SCOCollectionpublic void addAllInternal(Collection c)
addAllInternal in interface SCOCollectionpublic void addToBaseCollection(Object o)
SCOCollectionaddToBaseCollection in interface SCOCollectionpublic void removeAllInternal(Collection c)
SCOCollectionremoveAllInternal in interface SCOCollectionpublic Collection getAdded()
getAdded in interface SCOCollectionpublic Collection getRemoved()
getRemoved in interface SCOCollectionpublic void clearInternal()
clearInternal in interface SCOCollectionpublic void removeInternal(Object o)
removeInternal in interface SCOCollectionpublic void unsetOwner()
unsetOwner in interface SCOpublic Object getOwner()
public String getFieldName()
getFieldName in interface SCOpublic StateManager makeDirty()
public void applyUpdates(StateManager sm, boolean modified)
applyUpdates in interface SCOpublic void setOwner(Object owner, String fieldName, Class elementType)
setOwner in interface SCOCollectionowner - the new owner.fieldName - the new field name.elementType - the new element type as Class, or null if type
is not checked or not supported.SCOCollection.setOwner(java.lang.Object, java.lang.String, java.lang.Class)Copyright © 2017. All rights reserved.