net.xqhs.graphs.representation.text
Enum TextRepresentationElement.Symbol

java.lang.Object
  extended by java.lang.Enum<TextRepresentationElement.Symbol>
      extended by net.xqhs.graphs.representation.text.TextRepresentationElement.Symbol
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TextRepresentationElement.Symbol>
Enclosing class:
TextRepresentationElement

public static enum TextRepresentationElement.Symbol
extends java.lang.Enum<TextRepresentationElement.Symbol>

An enumeration of the characters that may appear in a textual representation. None of them is allowed to appear in the label of nodes or edges, except for EDGE_LIMIT, that may appear in edge labels.

These constants are used both at reading and at producing a representation.

Author:
Andrei Olaru

Enum Constant Summary
BRANCH_IN
          Symbol that marks the beginning of a subtree with the last node as root, that is not the last subtree of the root.
BRANCH_OUT
          Symbol that marks the beginning of a subtree with the last node as root, that is not the last subtree of the root.
EDGE_ENDING_BACKWARD
          Symbol that indicates the destination end of an edge in a 'backwards' representation.
EDGE_ENDING_FORWARD
          Symbol that indicates the destination end of an edge.
EDGE_LIMIT
          Symbol that marks the beginning of an edge, and may also be found immediately before the destination marker.
ELEMENT_CONTAINER_IN
          Symbol that marks the beginning of a container element (i.e.
ELEMENT_CONTAINER_OUT
          Symbol that marks the ending of a container element (i.e.
EXTERNAL_LINK_PREFIX
          Prefix to the representation of a node that is not part of the current subgraph.
INTERNAL_LINK_PREFIX
          Prefix to the representation of a node that has appeared previously (from left to right) in the representation.
SUBGRAPH_SEPARATOR
          Separator between the representations of two subgraphs.
 
Field Summary
private  java.lang.String symbol
          The actual textual representation of the symbol.
 
Method Summary
 java.lang.String toRegexp()
          Returns a value that can be included in a regular expressions pattern (as for String.split(String)) without worries that the characters in the symbol will be taken as special values.
 java.lang.String toString()
           
static TextRepresentationElement.Symbol valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static TextRepresentationElement.Symbol[] 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, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ELEMENT_CONTAINER_IN

public static final TextRepresentationElement.Symbol ELEMENT_CONTAINER_IN
Symbol that marks the beginning of a container element (i.e. of a graph).


ELEMENT_CONTAINER_OUT

public static final TextRepresentationElement.Symbol ELEMENT_CONTAINER_OUT
Symbol that marks the ending of a container element (i.e. of a graph).


SUBGRAPH_SEPARATOR

public static final TextRepresentationElement.Symbol SUBGRAPH_SEPARATOR
Separator between the representations of two subgraphs.


INTERNAL_LINK_PREFIX

public static final TextRepresentationElement.Symbol INTERNAL_LINK_PREFIX
Prefix to the representation of a node that has appeared previously (from left to right) in the representation.


EXTERNAL_LINK_PREFIX

public static final TextRepresentationElement.Symbol EXTERNAL_LINK_PREFIX
Prefix to the representation of a node that is not part of the current subgraph.


BRANCH_IN

public static final TextRepresentationElement.Symbol BRANCH_IN
Symbol that marks the beginning of a subtree with the last node as root, that is not the last subtree of the root.


BRANCH_OUT

public static final TextRepresentationElement.Symbol BRANCH_OUT
Symbol that marks the beginning of a subtree with the last node as root, that is not the last subtree of the root.


EDGE_LIMIT

public static final TextRepresentationElement.Symbol EDGE_LIMIT
Symbol that marks the beginning of an edge, and may also be found immediately before the destination marker. It may be contained inside the label of an edge.


EDGE_ENDING_FORWARD

public static final TextRepresentationElement.Symbol EDGE_ENDING_FORWARD
Symbol that indicates the destination end of an edge. It is followed by the representation of the destination node.


EDGE_ENDING_BACKWARD

public static final TextRepresentationElement.Symbol EDGE_ENDING_BACKWARD
Symbol that indicates the destination end of an edge in a 'backwards' representation. It is preceded by the representation of the destination node.

Field Detail

symbol

private java.lang.String symbol
The actual textual representation of the symbol.

Method Detail

values

public static TextRepresentationElement.Symbol[] 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 (TextRepresentationElement.Symbol c : TextRepresentationElement.Symbol.values())
    System.out.println(c);

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

valueOf

public static TextRepresentationElement.Symbol valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Enum<TextRepresentationElement.Symbol>

toRegexp

public java.lang.String toRegexp()
Returns a value that can be included in a regular expressions pattern (as for String.split(String)) without worries that the characters in the symbol will be taken as special values.

Returns:
the 'quoted' symbol value.