org.grinvin.graphs

Interface GraphBundleView

Known Subinterfaces:
GraphBundle
Known Implementing Classes:
DefaultGraphBundle, GraphBundleWithModels, LightweightGraphBundle

public interface GraphBundleView

Presents a read-only view of a graph bundle. Bundles contain information about a single (abstract) graph: its abstract representation, zero or more embeddings, name, description, etc. A single graph bundle typically corresponds to a single file on disk.

This interface only provides read access to the graph. Use the interface GraphBundle if you also need write access.

Method Summary

int[][]
adjacencyList()
Returns a (cached) adjacency list representation for the corresponding graph.
boolean[][]
booleanAdjacencyMatrix()
Return a (cached) boolean adjacency matrix for the corresponding graph.
int[][]
distanceMatrix()
Returns a (cached) distance matrix for the corresponding graph.
int[]
eccentricityList()
Returns a (cached) eccentricity list for the corresponding graph.
AnnotationView
getAnnotation()
Return the default annotation for this graph, or null if no such annotation is stored in the bundle.
AnnotationView
getAnnotation(int index)
Return the annotation with the given index.
int
getAnnotationCount()
Number of annotations stored in this bundle.
InvariantValue
getCachedInvariantValue(Invariant invariant)
Return the cached value of the graph for the given invariant, if available.
String
getDescription()
Return a textual description of this graph.
EmbeddingView
getEmbedding()
Return the default embedding for this graph, or null if no such embedding is stored in the bundle.
EmbeddingView
getEmbedding(int index)
Return the embedding with given index.
int
getEmbeddingCount()
Number of embeddings stored in this bundle.
GraphView
getGraph()
Abstract graph representation for this graph bundle.
GraphIconFactory
getGraphIconFactory()
Return the preferred GraphIconFactory to be used when displaying this graph as an icon.
InvariantValue
getInvariantValue(Invariant invariant)
Return the value of the graph for the given invariant.
Collection
getInvariantValues()
Return the collection of cached values of the invariants of the graph.
Set
getInvariants()
Return the set of invariants currently registered with this bundle.
String
getName()
Return the name of this graph.
InternationalizedProperties
getProperties()
Return the internationalized properties-object for this bundle.

Method Details

adjacencyList

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.


booleanAdjacencyMatrix

public boolean[][] booleanAdjacencyMatrix()
Return a (cached) boolean adjacency matrix for the corresponding graph. Row and column indices correspond to vertex indices. Entries are true when the corresponding vertices are adjacent (and different) and false 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.


distanceMatrix

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.

eccentricityList

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.


getAnnotation

public AnnotationView getAnnotation()
Return the default annotation for this graph, or null if no such annotation is stored in the bundle. The peer of this annotation is the graph returned by getGraph().

getAnnotation

public AnnotationView getAnnotation(int index)
Return the annotation with the given index. The peer of this annotation is the graph returned by getGraph().

getAnnotationCount

public int getAnnotationCount()
Number of annotations stored in this bundle.

getCachedInvariantValue

public InvariantValue getCachedInvariantValue(Invariant invariant)
Return the cached value of the graph for the given invariant, if available.
Parameters:
invariant - the URI of the invariant
Returns:
The value of the computed invariant or null if unavailable

getDescription

public String getDescription()
Return a textual description of this graph.
Returns:
getProperties().getProperty("graph.description")

getEmbedding

public EmbeddingView getEmbedding()
Return the default embedding for this graph, or null if no such embedding is stored in the bundle. The peer of this embedding is the graph returned by getGraph().

getEmbedding

public EmbeddingView 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 by getGraph().

getEmbeddingCount

public int getEmbeddingCount()
Number of embeddings stored in this bundle.

getGraph

public GraphView getGraph()
Abstract graph representation for this graph bundle.

getGraphIconFactory

public GraphIconFactory getGraphIconFactory()
Return the preferred GraphIconFactory to be used when displaying this graph as an icon.

getInvariantValue

public InvariantValue getInvariantValue(Invariant invariant)
Return the value of the graph for the given invariant.
Parameters:
invariant - the URI of the invariant
Returns:
The value of the computed invariant or null if unavailable

getInvariantValues

public Collection getInvariantValues()
Return the collection of cached values of the invariants of the graph.
Returns:
The current collection of invariant values

getInvariants

public Set getInvariants()
Return the set of invariants currently registered with this bundle.

getName

public String getName()
Return the name of this graph.
Returns:
getProperties().getProperty("graph.name")

getProperties

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.