org.bsf.smartValueObject.container
Class SmartSet

java.lang.Object
  |
  +--org.bsf.smartValueObject.container.AbstractSmartContainer
        |
        +--org.bsf.smartValueObject.container.SmartSet
All Implemented Interfaces:
java.util.Collection, java.io.Serializable, java.util.Set, SmartContainer, Versionable

public class SmartSet
extends AbstractSmartContainer
implements java.util.Set

A smart wrapper class around java.util.Set.

See Also:
SmartContainer, Set, Serialized Form

Field Summary
private  java.util.Set set
          The underlying set.
 
Fields inherited from class org.bsf.smartValueObject.container.AbstractSmartContainer
 
Constructor Summary
SmartSet(java.util.Set s, org.bsf.smartValueObject.Versionable v)
          Inititalize SmartCollection
 
Method Summary
 boolean addAll(java.util.Collection c)
           
protected  boolean addToContainer(java.lang.Object o)
          Add object to container.
protected  java.lang.Object addToContainer(java.lang.Object key, java.lang.Object o)
          Adds object to container with key.
protected  void containerClear()
          Deletes all elements from the container.
protected  boolean containerContains(java.lang.Object o)
          Verifies if the container has the specified object.
protected  boolean containerContainsKey(java.lang.Object key)
          Verifies if the container has the specified key.
protected  java.util.Iterator containerIterator()
          Gets the standard iterator for this container.
protected  int containerSize()
          The 'raw' size of the container.
 boolean containsAll(java.util.Collection c)
           
 java.lang.Object getContainer()
          Gets the backing container containing all elements.
protected  java.lang.Object getFromContainer(java.lang.Object key)
          Gets object from container.
 java.util.Iterator getIterator()
          Gets the backing iterator for all elements.
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection c)
           
protected  boolean removeFromContainer(java.lang.Object o)
          Removes object from container.
protected  java.lang.Object removeKeyFromContainer(java.lang.Object key)
          Removes key from container.
 boolean retainAll(java.util.Collection c)
           
protected  java.lang.Object[] toObjectArray()
          Retrieves objects as an array.
 java.lang.String toString()
           
 
Methods inherited from class org.bsf.smartValueObject.container.AbstractSmartContainer
add, addObject, addObject, clear, contains, containsKey, containsObject, containsValue, create, delete, get, getCreated, getDeleted, getVersionId, isCreated, isDeleted, isDirty, isEmpty, iterator, markClean, put, removeObject, removeObjectByKey, setVersionId, size, toArray, toArray, touch, touch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
add, clear, contains, equals, hashCode, isEmpty, iterator, size, toArray, toArray
 

Field Detail

set

private java.util.Set set
The underlying set.

Constructor Detail

SmartSet

public SmartSet(java.util.Set s,
                org.bsf.smartValueObject.Versionable v)
Inititalize SmartCollection

Parameters:
s - set to be wrapped.
v - version object
Method Detail

addToContainer

protected boolean addToContainer(java.lang.Object o)
Description copied from class: AbstractSmartContainer
Add object to container.

Specified by:
addToContainer in class AbstractSmartContainer
Parameters:
o - the object to be added.
Returns:

addToContainer

protected java.lang.Object addToContainer(java.lang.Object key,
                                          java.lang.Object o)
Description copied from class: AbstractSmartContainer
Adds object to container with key.

Specified by:
addToContainer in class AbstractSmartContainer
Parameters:
key - the key to use.
o - the object to be added.
Returns:

getFromContainer

protected java.lang.Object getFromContainer(java.lang.Object key)
Description copied from class: AbstractSmartContainer
Gets object from container.

Specified by:
getFromContainer in class AbstractSmartContainer
Parameters:
key - the key of the object.
Returns:

removeFromContainer

protected boolean removeFromContainer(java.lang.Object o)
Description copied from class: AbstractSmartContainer
Removes object from container.

Specified by:
removeFromContainer in class AbstractSmartContainer
Parameters:
o - the object to be removed.
Returns:

removeKeyFromContainer

protected java.lang.Object removeKeyFromContainer(java.lang.Object key)
Description copied from class: AbstractSmartContainer
Removes key from container.

Specified by:
removeKeyFromContainer in class AbstractSmartContainer
Parameters:
key - the key to be removed.
Returns:

containerContains

protected boolean containerContains(java.lang.Object o)
Description copied from class: AbstractSmartContainer
Verifies if the container has the specified object.

Specified by:
containerContains in class AbstractSmartContainer
Parameters:
o -
Returns:

containerContainsKey

protected boolean containerContainsKey(java.lang.Object key)
Description copied from class: AbstractSmartContainer
Verifies if the container has the specified key.

Specified by:
containerContainsKey in class AbstractSmartContainer
Parameters:
key -
Returns:

containerSize

protected int containerSize()
Description copied from class: AbstractSmartContainer
The 'raw' size of the container.

Specified by:
containerSize in class AbstractSmartContainer
Returns:
size of the container.

containerIterator

protected java.util.Iterator containerIterator()
Description copied from class: AbstractSmartContainer
Gets the standard iterator for this container.

Specified by:
containerIterator in class AbstractSmartContainer
Returns:
iterator.

containerClear

protected void containerClear()
Description copied from class: AbstractSmartContainer
Deletes all elements from the container.

Specified by:
containerClear in class AbstractSmartContainer

toObjectArray

protected java.lang.Object[] toObjectArray()
Description copied from class: AbstractSmartContainer
Retrieves objects as an array.

Specified by:
toObjectArray in class AbstractSmartContainer
Returns:

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Set

containsAll

public boolean containsAll(java.util.Collection c)
Specified by:
containsAll in interface java.util.Set

addAll

public boolean addAll(java.util.Collection c)
Specified by:
addAll in interface java.util.Set

retainAll

public boolean retainAll(java.util.Collection c)
Specified by:
retainAll in interface java.util.Set

removeAll

public boolean removeAll(java.util.Collection c)
Specified by:
removeAll in interface java.util.Set

getIterator

public java.util.Iterator getIterator()
Description copied from interface: SmartContainer
Gets the backing iterator for all elements.

Specified by:
getIterator in interface SmartContainer
Overrides:
getIterator in class AbstractSmartContainer
Returns:
the underlying iterator.

getContainer

public java.lang.Object getContainer()
Description copied from interface: SmartContainer
Gets the backing container containing all elements.

Specified by:
getContainer in interface SmartContainer
Specified by:
getContainer in class AbstractSmartContainer
Returns:
the underlying container.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object