org.graphstream.graph
Interface Structure

All Known Subinterfaces:
Graph
All Known Implementing Classes:
AbstractGraph, AdjacencyListGraph, DefaultGraph, GraphicGraph, MultiGraph, Path, SingleGraph

public interface Structure

Structures are generic objects which may contain nodes and edges.


Method Summary
<T extends Edge>
Iterable<? extends T>
getEachEdge()
          Set of edges usable in a for-each instruction.
<T extends Node>
Iterable<? extends T>
getEachNode()
          Set of nodes usable in a for-each instruction.
 int getEdgeCount()
          Number of edges in this graph.
<T extends Edge>
Iterator<T>
getEdgeIterator()
          Iterator on the set of edges, in an undefined order.
<T extends Edge>
Collection<T>
getEdgeSet()
          Unmodifiable view of the set of edges.
 int getNodeCount()
          Number of nodes in this graph.
<T extends Node>
Iterator<T>
getNodeIterator()
          Iterator on the set of nodes, in an undefined order.
<T extends Node>
Collection<T>
getNodeSet()
          Unmodifiable view of the set of nodes.
 

Method Detail

getNodeCount

int getNodeCount()
Number of nodes in this graph.

Returns:
The number of nodes.

getEdgeCount

int getEdgeCount()
Number of edges in this graph.

Returns:
The number of edges.

getNodeIterator

<T extends Node> Iterator<T> getNodeIterator()
Iterator on the set of nodes, in an undefined order. This method is implicitly generic and returns an Iterator over something which extends Node. The return type is the one of the left part of the assignment. For example, in the following call :
 Iterator<ExtendedNode> ite = graph.getNodeIterator();
 
the method will return an Iterator<ExtendedNode>. If no left part exists, method will just return an Iterator<Node>.

Returns:
The iterator.

getEdgeIterator

<T extends Edge> Iterator<T> getEdgeIterator()
Iterator on the set of edges, in an undefined order. This method is implicitly generic and returns an Iterator over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
 Iterator<ExtendedEdge> ite = graph.getEdgeIterator();
 
the method will return an Iterator<ExtendedEdge>. If no left part exists, method will just return an Iterator<Edge>.

Returns:
The iterator.

getEachNode

<T extends Node> Iterable<? extends T> getEachNode()
Set of nodes usable in a for-each instruction. This method is implicitly generic and returns an Iterable over something which extends Node. The return type is the one of the left part of the assignment. For example, in the following call :
 Iterable<ExtendedNode> ite = struct.getEachNode();
 
the method will return an Iterable<ExtendedNode>. If no left part exists, method will just return an Iterable<Node>. It is possible to use it in a for-each loop by giving the parameter :
 for (ExtendedNode n : struct.<ExtendedNode> getEachNode()) {
        // ...
 }
 

Returns:
An "iterable" view of the set of nodes.
See Also:
getNodeIterator(), getEachNode()

getEachEdge

<T extends Edge> Iterable<? extends T> getEachEdge()
Set of edges usable in a for-each instruction. This method is implicitly generic and returns an Iterable over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
 Iterable<ExtendedNEdge> ite = struct.getEachEdge();
 
the method will return an Iterable<ExtendedEdge>. If no left part exists, method will just return an Iterable<Edge>. It is possible to use it in a for-each loop by giving the parameter :
 for (ExtendedEdge e : struct.<ExtendedEdge> getEachEdge()) {
        // ...
 }
 

Returns:
An "iterable" view of the set of edges.
See Also:
getEdgeIterator(), getEdgeSet()

getNodeSet

<T extends Node> Collection<T> getNodeSet()
Unmodifiable view of the set of nodes. This method is implicitly generic and returns a Collection of something which extends Node. The return type is the one of the left part of the assignment. For example, in the following call :
 Collection<ExtendedNode> c = struct.getNodeSet();
 
the method will return a Collection<ExtendedNode>. If no left part exists, method will just return a Collection<Node>.

Returns:
A set of nodes that can only be read, not changed.
See Also:
getNodeIterator(), getEachNode()

getEdgeSet

<T extends Edge> Collection<T> getEdgeSet()
Unmodifiable view of the set of edges. This method is implicitly generic and returns a Collection of something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
 Collection<ExtendedEdge> c = struct.getEdgeSet();
 
the method will return a Collection<ExtendedEdge>. If no left part exists, method will just return a Collection<Edge>.

Returns:
A set of edges that can only be read, not changed.
See Also:
getEdgeIterator(), getEachEdge()


Copyright © 2012. All Rights Reserved.