Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.grinvin.graphs.DefaultGraphBundle
GraphBundle
. Uses DefaultGraph
and
DefaultEmbedding
to represent the bundle.
Field Summary | |
protected Map | |
protected List | |
protected List | |
protected DefaultGraph | |
protected GraphIconFactory | |
protected List | |
protected InternationalizedProperties |
Constructor Summary | |
|
Method Summary | |
void |
|
void |
|
int[][] |
|
boolean[][] |
|
DefaultAnnotation |
|
DefaultEmbedding |
|
DefaultGraph |
|
int[][] |
|
int[] |
|
void | |
DefaultAnnotation |
|
DefaultAnnotation |
|
int |
|
InvariantValue |
|
String |
|
DefaultEmbedding |
|
DefaultEmbedding |
|
int |
|
DefaultGraph |
|
GraphIconFactory |
|
InvariantValue |
|
Collection |
|
Set |
|
String |
|
InternationalizedProperties |
|
void |
|
void |
|
void |
|
void |
|
void |
|
protected MapinvariantValues
protected Listannotations
protected Listembeddings
protected Listlisteners
public void addGraphBundleListener(GraphBundleListener listener)
- Specified by:
- addGraphBundleListener in interface GraphBundle
public void addInvariantValue(InvariantValue value)
Add the given InvariantValue as a cached value to this bundle
- Specified by:
- addInvariantValue in interface GraphBundle
- Parameters:
value
- The InvariantValue to be added to this bundle.
public int[][] adjacencyList()
Returns a (cached) adjacency list representation for the corresponding graph. The resulting array contains an array of neighbour indices for every vertex. The length of each array is exactly the valency of the corresponding vertex. Important: The return value should be considered read only and is valid only as long as the graph in the bundle is not changed.
- Specified by:
- adjacencyList in interface GraphBundleView
public boolean[][] booleanAdjacencyMatrix()
Return a (cached) boolean adjacency matrix for the corresponding graph. Row and column indices correspond to vertex indices. Entries aretrue
when the corresponding vertices are adjacent (and different) andfalse
otherwise. Important: The return value should be considered read only and is valid only as long as the graph in the bundle is not changed.
- Specified by:
- booleanAdjacencyMatrix in interface GraphBundleView
public DefaultAnnotation createAnnotation()
Factory method which creates a new (empty) annotation and installs it as the next annotation in this bundle, i.e., the annotation with the next available index. This annotation should have the graph returned byGraphBundle.getGraph()
as a peer. Subsequent calls toGraphBundle
with the appropriate index, should return the annotation created by this method.
- Specified by:
- createAnnotation in interface GraphBundle
- Returns:
- the annotation created or null when the graph bundle does not support annotations.
public DefaultEmbedding createEmbedding()
Factory method which creates a new (empty) embedding and installs it as the next embedding in this bundle, i.e., the embedding with the next available index. This embedding should have the graph returned byGraphBundle.getGraph()
as a peer. Subsequent calls toGraphBundle
with the appropriate index, should return the embedding created by this method.
- Specified by:
- createEmbedding in interface GraphBundle
- Returns:
- the embedding created or null when the graph bundle does not support embeddings.
public DefaultGraph createGraph()
Factory method which creates a new (empty) graph for this bundle. Subsequent calls toGraphBundle.getGraph()
should return this graph.
- Specified by:
- createGraph in interface GraphBundle
- Returns:
- the graph created
public int[][] distanceMatrix()
Returns a (cached) distance matrix for the corresponding graph. Row and column indices correspond to vertex indices. Entries contains the distance between corresponding vertices or 0 when vertices are equal or belong to different components of the graph.
- Specified by:
- distanceMatrix in interface GraphBundleView
public int[] eccentricityList()
Returns a (cached) eccentricity list for the corresponding graph. The resulting array contains the eccentricity for every vertex. Important: The return value should be considered read only and is valid only as long as the graph in the bundle is not changed.
- Specified by:
- eccentricityList in interface GraphBundleView
public void fireGraphBundleChanged()
public DefaultAnnotation getAnnotation()
Return the default annotation for this graph, ornull
if no such annotation is stored in the bundle. The peer of this annotation is the graph returned byGraphBundleView.getGraph()
.
- Specified by:
- getAnnotation in interface GraphBundleView
public DefaultAnnotation getAnnotation(int index)
Return the annotation with the given index. The peer of this annotation is the graph returned byGraphBundleView.getGraph()
.
- Specified by:
- getAnnotation in interface GraphBundleView
public int getAnnotationCount()
Number of annotations stored in this bundle.
- Specified by:
- getAnnotationCount in interface GraphBundleView
public InvariantValue getCachedInvariantValue(Invariant invariant)
Return the cached value of the graph for the given invariant, if available.
- Specified by:
- getCachedInvariantValue in interface GraphBundleView
- Parameters:
invariant
- the URI of the invariant
- Returns:
- The value of the computed invariant or null if unavailable
public String getDescription()
Return a textual description of this graph.
- Specified by:
- getDescription in interface GraphBundleView
- Returns:
getProperties().getProperty("graph.description")
public DefaultEmbedding getEmbedding()
Return the default embedding for this graph, ornull
if no such embedding is stored in the bundle. The peer of this embedding is the graph returned byGraphBundleView.getGraph()
.
- Specified by:
- getEmbedding in interface GraphBundleView
public DefaultEmbedding getEmbedding(int index)
Return the embedding with given index. Index 0 corresponds to the default embedding. The peer of this embedding is the graph returned byGraphBundleView.getGraph()
.
- Specified by:
- getEmbedding in interface GraphBundleView
public int getEmbeddingCount()
Number of embeddings stored in this bundle.
- Specified by:
- getEmbeddingCount in interface GraphBundleView
public DefaultGraph getGraph()
Abstract graph representation for this graph bundle.
- Specified by:
- getGraph in interface GraphBundle
- getGraph in interface GraphBundleView
public GraphIconFactory getGraphIconFactory()
Return the preferredGraphIconFactory
to be used when displaying this graph as an icon.
- Specified by:
- getGraphIconFactory in interface GraphBundleView
public InvariantValue getInvariantValue(Invariant invariant)
Return the value of the graph for the given invariant.
- Specified by:
- getInvariantValue in interface GraphBundleView
- Parameters:
invariant
- the URI of the invariant
- Returns:
- The value of the computed invariant or null if unavailable
public CollectiongetInvariantValues()
Return the collection of cached values of the invariants of the graph.
- Specified by:
- getInvariantValues in interface GraphBundleView
- Returns:
- The current collection of invariant values
public SetgetInvariants()
Return the set of invariants currently registered with this bundle.
- Specified by:
- getInvariants in interface GraphBundleView
public String getName()
Return the name of this graph.
- Specified by:
- getName in interface GraphBundleView
- Returns:
getProperties().getProperty("graph.name")
public InternationalizedProperties getProperties()
Return the internationalized properties-object for this bundle. Currently the following property keys should be supported:
- graph.name Name of this graph.
- graph.description Textual description of this graph.
- embedding_i.description Textual description of the embedding with index i, with i > 0.
- Specified by:
- getProperties in interface GraphBundleView
public void invalidate()
Clear all cached values for this bundle (i.e. cached InvariantValues and other cached values such as eigenvalues, adjacency lists,...).
- Specified by:
- invalidate in interface GraphBundle
public void invalidate(InvariantValue value)
Remove the given InvariantValue from the cache of this bundle.
- Specified by:
- invalidate in interface GraphBundle
- Parameters:
value
- The InvariantValue to be removed from this bundle.
public void removeGraphBundleListener(GraphBundleListener listener)
- Specified by:
- removeGraphBundleListener in interface GraphBundle
public void setGraphIconFactory(GraphIconFactory graphIconFactory)
Set the graph icon factory used for displaying this graph as an icon.
- Specified by:
- setGraphIconFactory in interface GraphBundle
public void setProperties(InternationalizedProperties properties)
Set the internationalized properties for this graph.
- Specified by:
- setProperties in interface GraphBundle