fr.inria.opengve.bridge.interfaces
Interface Cycle<V,E extends Link<V>>


public interface Cycle<V,E extends Link<V>>

Cycle is define as an undirected path in which :

Author:
fabrice.peix@sophia.inria.fr

Method Summary
 boolean contains(E edge)
          Tell if this cycle contains a given edge.
 boolean contains(V vertex)
          Tell if this cycle contains a given vertex.
 java.util.Iterator<E> edgeIterator()
          Give an Iterator on the edges of this cycle.
 java.util.Iterator<E> edgeIterator(E firstEdge)
          Give an Iterator on the edges of this cycle.
 E[] getEdges(V vertex)
          Returns the two edges containing the given vertex in a 2-elements array where one edge is placed in the first position (index 0) and the other edge occupies the second position (index 1).
 boolean isDirected()
          Tell if this cycle is directed or not.
 int length()
          Give the length of this cycle (in terms of edges).
 java.util.Iterator<V> vertexIterator()
          Give an Iterator on the vertices of this cycle.
 java.util.Iterator<V> vertexIterator(V firstVertex)
          Give an Iterator on the vertices of this cycle.
 

Method Detail

contains

boolean contains(V vertex)
Tell if this cycle contains a given vertex.

Parameters:
vertex - The vertex.
Returns:
true if the given vertex belong to this cycle and false otherwise.

contains

boolean contains(E edge)
Tell if this cycle contains a given edge.

Parameters:
edge - The edge.
Returns:
true if the given edge belong to this cycle and false otherwise.

vertexIterator

java.util.Iterator<V> vertexIterator()
Give an Iterator on the vertices of this cycle. The first returned vertices and the direction of the course of the cycle are undetermined. You must note that the remove operation of the returned Iterator is unsuported.

Returns:
A vertices Iterator.

vertexIterator

java.util.Iterator<V> vertexIterator(V firstVertex)
Give an Iterator on the vertices of this cycle. The first returned vertices is given as argtument and the direction of the course of the cycle is undetermined. You must note that the remove operation of the returned Iterator is unsuported.

Parameters:
firstVertex - The first returned vertex.
Returns:
A vertices Iterator.
Throws:
java.lang.IllegalArgumentException - If firstVertex does not belong to this cycle.

edgeIterator

java.util.Iterator<E> edgeIterator()
Give an Iterator on the edges of this cycle. The first returned edges and the direction of the course of the cycle are undetermined. You must note that the remove operation of the returned Iterator is unsuported.

Returns:
An edges Iterator.

edgeIterator

java.util.Iterator<E> edgeIterator(E firstEdge)
Give an Iterator on the edges of this cycle. The first returned edges is given as argument and the direction of the course of the cycle is undetermined. You must note that the remove operation of the returned Iterator is unsuported.

Parameters:
firstEdge - the first edge returned by the Iterator
Returns:
An edges Iterator.
Throws:
java.lang.IllegalArgumentException - If firstEdge does not belong to this cycle.

getEdges

E[] getEdges(V vertex)
Returns the two edges containing the given vertex in a 2-elements array where one edge is placed in the first position (index 0) and the other edge occupies the second position (index 1). The edges appear in the returned array in an unpredictable way.

Parameters:
vertex - The vertex.
Returns:
a 2-elements array of edges
Throws:
java.util.NoSuchElementException - if the vertex does not belong to this cycle.

length

int length()
Give the length of this cycle (in terms of edges).

Returns:
the number of edges belonging to this cycle.

isDirected

boolean isDirected()
Tell if this cycle is directed or not.

Returns:
true if this cycle is directed and false otherwise.


Copyright © 2009 INRIA (Projet Mascotte). All Rights Reserved.