mascoptLib.abstractGraph
Class MascoptFixedSet

java.lang.Object
  extended bymascoptLib.util.ObservableObject
      extended bymascoptLib.abstractGraph.MascoptObject
          extended bymascoptLib.abstractGraph.MascoptFixedSet
All Implemented Interfaces:
Cloneable, Collection, MascoptObjectInterface, Observer, Set
Direct Known Subclasses:
MascoptSet

public class MascoptFixedSet
extends MascoptObject
implements Set

This class implements the concept of MascoptSet. A new implementation was needed in order to comply more closely with the object oriented way of doing things. Basically, a MascoptSet object is a MascoptObject object which contains a LinkedHashset to store objects. Advanced users can control the intialCapacity and the loadFactor of their sets, to deals with the size of their graphs.


Field Summary
static int initialCapacity
          The initial capacity of a MascoptFixedSet.
static float loadFactor
          The load Factor of a MascoptFixedSet.
 
Constructor Summary
MascoptFixedSet()
          The constructor of a Mascopt Fixed Set.
MascoptFixedSet(MascoptFixedSet superSet)
          Constuctor for subsets.
 
Method Summary
 boolean add(Object object)
           
 boolean addAll(Collection collection)
           
 void clear()
           
 boolean contains(Object object)
          Describe contains method here.
 boolean containsAll(Collection collection)
          Describe containsAll method here.
static int countAllSets()
          Return the number of sets currently in memory
 boolean equals(Object object)
          Describe equals method here.
 void free()
          Free memory when this object is linked.
 MascoptFixedSet getSuperSet()
          Returns the super set of the object if exists.
 int hashCode()
          Describe hashCode method here.
 boolean isEmpty()
          Describe isEmpty method here.
 boolean isSubSet()
          Says if the object is a subset of an other.
 Iterator iterator()
          Describe iterator method here.
 boolean remove(Object object)
           
 boolean removeAll(Collection collection)
           
 boolean retainAll(Collection collection)
           
 boolean setSuperSet(MascoptFixedSet superSet)
          Sets the supersets without verification.
 int size()
          Describe size method here.
 Object[] toArray()
          Describe toArray method here.
 MascoptObject[] toArray(MascoptObject[] mascoptObjectArray)
          Describe toArray method here.
 Object[] toArray(Object[] objectArray)
          Describe toArray method here.
 String toString()
          Object string output.
 
Methods inherited from class mascoptLib.abstractGraph.MascoptObject
copyValues, countAllObjects, deleteValue, deleteValue, existValue, existValue, getDoubleValue, getDoubleValue, getDouValue, getDouValue, getId, getIntegerValue, getIntegerValue, getIntValue, getIntValue, getName, getValue, getValue, getValueContexts, getValueDataType, getValueDataType, getValueEntries, notifyOnValueChange, removeAllValues, setDoubleValue, setDoubleValue, setDouValue, setDouValue, setIntegerValue, setIntegerValue, setIntValue, setIntValue, setName, setValue, setValue, setValue, setValue, setValue, setValue, update
 
Methods inherited from class mascoptLib.util.ObservableObject
addAddObserver, addRemoveObserver, addValueObserver, countAddObservers, countRemoveObservers, countValueObservers, deleteAddObserver, deleteAddObserver, deleteRemoveObserver, deleteRemoveObserver, deleteValueObserver, deleteValueObserver
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

initialCapacity

public static int initialCapacity
The initial capacity of a MascoptFixedSet. This paramerer refers to the initial capacity of the backend LinkedHashSet. By default, we use the default value: 16. This parameter is static: it regulates all the MascoptFixedSet.


loadFactor

public static float loadFactor
The load Factor of a MascoptFixedSet. This parameter refers to the load factor of the backend LinkedHashSet. By default, we use the default value: 0.75. This parameter is static: it regulates all the MascoptFixedSet.

Constructor Detail

MascoptFixedSet

public MascoptFixedSet()
The constructor of a Mascopt Fixed Set. It uses internaly a LinkedHashSet.


MascoptFixedSet

public MascoptFixedSet(MascoptFixedSet superSet)
Constuctor for subsets. Use a superset to construct a subset. The subset will be empty. The set can easily be filled with the method add or addAll.

Parameters:
superSet - the super set to use.
Method Detail

getSuperSet

public MascoptFixedSet getSuperSet()
Returns the super set of the object if exists.

Returns:
the super set of the object if exists.

isSubSet

public boolean isSubSet()
Says if the object is a subset of an other.

Returns:
true if the object is a subset of an other.

setSuperSet

public boolean setSuperSet(MascoptFixedSet superSet)
Sets the supersets without verification. Be carefull with this method.

Parameters:
superSet - the superSet to use for the set.

hashCode

public int hashCode()
Describe hashCode method here.

Specified by:
hashCode in interface Set
Returns:
an int value

equals

public boolean equals(Object object)
Describe equals method here.

Specified by:
equals in interface Set
Parameters:
object - an Object value
Returns:
a boolean value

contains

public boolean contains(Object object)
Describe contains method here.

Specified by:
contains in interface Set
Parameters:
object - an Object value
Returns:
a boolean value

size

public int size()
Describe size method here.

Specified by:
size in interface Set
Returns:
an int value

toArray

public Object[] toArray()
Describe toArray method here.

Specified by:
toArray in interface Set
Returns:
a MascoptObject[] value

toArray

public Object[] toArray(Object[] objectArray)
Describe toArray method here.

Specified by:
toArray in interface Set
Parameters:
objectArray - an Object[] value
Returns:
a Object[] value

toArray

public MascoptObject[] toArray(MascoptObject[] mascoptObjectArray)
Describe toArray method here.

Returns:
a MascoptObject[] value

iterator

public Iterator iterator()
Describe iterator method here.

Specified by:
iterator in interface Set
Returns:
an Iterator value

isEmpty

public boolean isEmpty()
Describe isEmpty method here.

Specified by:
isEmpty in interface Set
Returns:
a boolean value

containsAll

public boolean containsAll(Collection collection)
Describe containsAll method here.

Specified by:
containsAll in interface Set
Parameters:
collection - a Collection value
Returns:
a boolean value

free

public void free()
Free memory when this object is linked.

Overrides:
free in class MascoptObject

countAllSets

public static int countAllSets()
Return the number of sets currently in memory


toString

public String toString()
Object string output.


add

public boolean add(Object object)
Specified by:
add in interface Set

remove

public boolean remove(Object object)
Specified by:
remove in interface Set

addAll

public boolean addAll(Collection collection)
Specified by:
addAll in interface Set

clear

public void clear()
Specified by:
clear in interface Set

removeAll

public boolean removeAll(Collection collection)
Specified by:
removeAll in interface Set

retainAll

public boolean retainAll(Collection collection)
Specified by:
retainAll in interface Set