mascoptLib.abstractGraph
Class AbstractEdgeSet

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

public abstract class AbstractEdgeSet
extends MascoptSet

The AbstractEdgeSet class is derivated from MascoptSet. It allows grouping AbstractEdge objects into a set.


Field Summary
 
Fields inherited from class mascoptLib.abstractGraph.MascoptFixedSet
initialCapacity, loadFactor
 
Constructor Summary
AbstractEdgeSet()
          Default constructor.
AbstractEdgeSet(AbstractEdgeSet edgeSet)
          Creates a subset of a set of edges.
AbstractEdgeSet(AbstractEdgeSet es, AbstractVertexSet abstractVertexSet)
          Create a subset of a set of edges based on another vertex set.
AbstractEdgeSet(AbstractEdgeSet originalSet, boolean copyElements)
          Constructor for copy sets.
AbstractEdgeSet(AbstractVertexSet abstractVertexSet)
          This constructor Creates an set of edges based on a set of vertices.
 
Method Summary
 boolean add(AbstractEdge o)
          Adds an edge in the edge set
 boolean addAll(AbstractEdgeSet es)
          Adds all edges from an other set of edges
static long countAllAbstractEdgeSets()
          Counts the number of edge sets.
 void free()
          Free memory when this object is linked.
 AbstractVertexSet getAbstractVertexSet()
          Returns the vertex set on wich is based the edge set
abstract  AbstractEdgeSetFactory getFactory()
          Returns the library objects factory.
 boolean remove(AbstractEdge o)
          Removes an edge from edgeset
 void update(Observable o, Object arg)
          For the library coherence.
 
Methods inherited from class mascoptLib.abstractGraph.MascoptSet
add, add, addAll, clear, remove, remove, removeAll, removeAllValues, removeAllValuesOnElementsOfset, retainAll, setValueForAllElements, setValueForAllElements
 
Methods inherited from class mascoptLib.abstractGraph.MascoptFixedSet
contains, containsAll, countAllSets, equals, getSuperSet, hashCode, isEmpty, isSubSet, iterator, setSuperSet, size, toArray, toArray, toArray, toString
 
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, wait, wait, wait
 
Methods inherited from interface java.util.Set
contains, containsAll, equals, hashCode, isEmpty, iterator, size, toArray, toArray
 

Constructor Detail

AbstractEdgeSet

public AbstractEdgeSet()
Default constructor. The use of this constructor should be avoided as it you should then reconstruct manually the inter-observation chain between the objects.


AbstractEdgeSet

public AbstractEdgeSet(AbstractVertexSet abstractVertexSet)
This constructor Creates an set of edges based on a set of vertices. Only edges that can be related to this vertex can be added.

Parameters:
abstractVertexSet - the set of vertices base of edges.

AbstractEdgeSet

public AbstractEdgeSet(AbstractEdgeSet edgeSet)
Creates a subset of a set of edges. The subset is empty when created. The set can easily be filled with the method add and addAll.


AbstractEdgeSet

public AbstractEdgeSet(AbstractEdgeSet es,
                       AbstractVertexSet abstractVertexSet)
Create a subset of a set of edges based on another vertex set. Useful to create subgraphs. We define subgraph with a se of edges include in the parent set of edges and a set of vertices included in the parent set of edges. The added constraint is that the subset of edges must be coherent with the subset of vertices. Then we call that a subgraph.

Parameters:
es - the parent set of edges
abstractVertexSet - the parent set of vertices

AbstractEdgeSet

public AbstractEdgeSet(AbstractEdgeSet originalSet,
                       boolean copyElements)
Constructor for copy sets. Creates a new AbstractEdgeSet similar to originalSet. If copyElements is set to true then all the elements of originalSet are duplicated (and of course their id is changed) and the structure of the set is preserved (there exists an isomorphism between originalSet and the new set). In that case, the simple values are also copied, but those depending on a context are dropped. If copyElements is set to false, then the new set's elements point to those of originalSet.

Parameters:
originalSet - - the set to be copied.
copyElements - - indicates if the elements of the set have to be duplicated
Method Detail

getFactory

public abstract AbstractEdgeSetFactory getFactory()
Returns the library objects factory.


update

public void update(Observable o,
                   Object arg)
For the library coherence. Behavior of edgeset when other objects changes

Specified by:
update in interface Observer
Overrides:
update in class MascoptObject
Parameters:
o - an Observable value
arg - an Object value

add

public boolean add(AbstractEdge o)
Adds an edge in the edge set

Parameters:
o - the edge to add

addAll

public boolean addAll(AbstractEdgeSet es)
Adds all edges from an other set of edges

Parameters:
es - the AbstractEdgeSet to add
Returns:
a boolean which is true if each element has been succesfully added

remove

public boolean remove(AbstractEdge o)
Removes an edge from edgeset

Parameters:
o - the edge to remove

getAbstractVertexSet

public AbstractVertexSet getAbstractVertexSet()
Returns the vertex set on wich is based the edge set


countAllAbstractEdgeSets

public static long countAllAbstractEdgeSets()
Counts the number of edge sets.


free

public void free()
Free memory when this object is linked. This method is necessary when an edge set is a sub set of an other edge set. As this sub set is listening to his father (for changes), it is not removed of memory when no one is pointing to it (because the father is still pointing to it). So, when the user does not use this object anymore, he must free it from his father.

Overrides:
free in class MascoptFixedSet