slib.sglib.model.graph.utils
Enum Direction

java.lang.Object
  extended by java.lang.Enum<Direction>
      extended by slib.sglib.model.graph.utils.Direction
All Implemented Interfaces:
Serializable, Comparable<Direction>

public enum Direction
extends Enum<Direction>

Enumeration used to characterized the Direction of an edge.

Author:
Harispe Sébastien

Enum Constant Summary
BOTH
          The Direction corresponding to the edges going from or to a vertex.
IN
          The Direction corresponding to the edges going to a vertex.
OUT
          The Direction corresponding to the edges going from a vertex.
 
Method Summary
 Direction getOpposite()
          Return the opposite direction of a particular Direction.
static Direction valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Direction[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

IN

public static final Direction IN
The Direction corresponding to the edges going to a vertex. That is to say the edges for which the vertex is the target.


OUT

public static final Direction OUT
The Direction corresponding to the edges going from a vertex. That is to say the edges for which the vertex is the source.


BOTH

public static final Direction BOTH
The Direction corresponding to the edges going from or to a vertex. That is to say the edges for which the vertex is the source or target.

Method Detail

values

public static Direction[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Direction c : Direction.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Direction valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getOpposite

public Direction getOpposite()
Return the opposite direction of a particular Direction.

Returns:
the opposite Direction.


Copyright © 2013. All Rights Reserved.