mascoptLib.abstractGraph
Class MascoptSet

java.lang.Object
  |
  +--mascoptLib.util.ObservableObject
        |
        +--mascoptLib.abstractGraph.MascoptObject
              |
              +--mascoptLib.abstractGraph.MascoptSet
All Implemented Interfaces:
Cloneable, Collection, MascoptObjectInterface, Observer, Set
Direct Known Subclasses:
AbstractEdgeSet, AbstractVertexSet

public abstract class MascoptSet
extends MascoptObject
implements Observer, Set, Collection

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 Hashset to store objects.


Constructor Summary
MascoptSet()
           
MascoptSet(MascoptSet superSet)
          Constuctor for subsets.
 
Method Summary
 boolean add(MascoptObject mascoptobject)
          Describe add method here.
 boolean add(Object object)
          Describe add method here.
 boolean addAll(Collection collection)
          Describe addAll method here.
 void clear()
          Describe clear method here.
 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.
 MascoptSet getSuperSet()
          Returns the super set of the object if exists.
 int hashCode()
          Describe hashCode method here.
 boolean isEditable()
          Specify if a set is editable or not.
 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(MascoptObject mascoptobject)
          Describe remove method here.
 boolean remove(Object object)
          Describe remove method here.
 boolean removeAll(Collection collection)
          Describe removeAll method here.
 void removeAllValues(MascoptObjectInterface context)
          Remove all values concerning a category.
 void removeAllValuesOnElementsOfset(MascoptObjectInterface context)
          Remove all values concerning a category.
 boolean retainAll(Collection collection)
          Describe retainAll method here.
 boolean setSuperSet(MascoptSet superSet)
          Sets the supersets without verification.
 void setValueForAllElements(String name, String value)
          Write values in the set for all elements.
 void setValueForAllElements(String name, String value, MascoptObjectInterface g)
          Write values in the set for all elements.
 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.
 void update(Observable observable, Object object)
          Describe update method here.
 
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, setDoubleValue, setDoubleValue, setDouValue, setDouValue, setIntegerValue, setIntegerValue, setIntValue, setIntValue, setName, setValue, setValue, setValue, setValue, setValue, setValue
 
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, toString, wait, wait, wait
 

Constructor Detail

MascoptSet

public MascoptSet()

MascoptSet

public MascoptSet(MascoptSet 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 MascoptSet 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(MascoptSet superSet)
Sets the supersets without verification. Be carefull with this method.

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

update

public void update(Observable observable,
                   Object object)
Describe update method here.

Specified by:
update in interface Observer
Parameters:
observable - an Observable value
object - an Object value

hashCode

public int hashCode()
Describe hashCode method here.

Specified by:
hashCode in interface Set
Overrides:
hashCode in class Object
Returns:
an int value

equals

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

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

addAll

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

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

add

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

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

add

public boolean add(MascoptObject mascoptobject)
Describe add method here.

Parameters:
mascoptobject - a MascoptObject 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

remove

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

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

remove

public boolean remove(MascoptObject mascoptobject)
Describe remove method here.

Returns:
a boolean value

clear

public void clear()
Describe clear method here.

Specified by:
clear in interface Set

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

removeAll

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

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

retainAll

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

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

setValueForAllElements

public void setValueForAllElements(String name,
                                   String value)
Write values in the set for all elements. This values are global (no context).

Parameters:
name - the string reprensenting the parameter
value - the value to write for this parameter

setValueForAllElements

public void setValueForAllElements(String name,
                                   String value,
                                   MascoptObjectInterface g)
Write values in the set for all elements. This values are contexted by a graph.

Parameters:
name - the string reprensenting the parameter
value - the value to write for this parameter
g - the graph representing the context

removeAllValuesOnElementsOfset

public void removeAllValuesOnElementsOfset(MascoptObjectInterface context)
Remove all values concerning a category. This method is usefull when some values used in an algorithm are no more needed. If you omit to remove the values, the object continues to have a pointer on the context. Then the context cannot be destroyed because a value points on it. Think about be sure to remove all values pointing on a context to free memory.

Parameters:
context - the oject context

removeAllValues

public void removeAllValues(MascoptObjectInterface context)
Remove all values concerning a category. This method is usefull when some values used in an algorithm are no more needed. If you omit to remove the values, the object continues to have a pointer on the context. Then the context cannot be destroyed because a value points on it. Think about be sure to remove all values pointing on a context to free memory.

Overrides:
removeAllValues in class MascoptObject
Parameters:
context - the oject context

isEditable

public boolean isEditable()
Specify if a set is editable or not. A set can be not editable for the protection of data.

Returns:
true if the set is editable.

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