com.e4graph
Class Vertex

java.lang.Object
  |
  +--com.e4graph.Vertex

public final class Vertex
extends java.lang.Object


Field Summary
static int BYTES
          BYTES is a possible value for the type of the value of a vertex, denoting a value of type array of byte.
static int DOUBLE
          DOUBLE is a possible value for the type of the value of a vertex, denoting a double (64 bit floating point) value.
static int ILLEGAL
          ILLEGAL is a possible value for the type of the value of a vertex, denoting an illegal value type.
static int INTEGER
          INTEGER is a possible value for the type of the value of a vertex, denoting an integer value type.
static int INVALID
          This value represents the vertexIndex for an invalid vertex.
static int NODE
          NODE is a possible value for the type of the value of a vertex, denoting a value of type com.e4graph.Node.
static int STRING
          STRING is a possible value for the type of the value of a vertex, denoting a java.lang.String value.
 
Method Summary
 com.e4graph.Node containingNode()
          Retrieve the node in which this vertex appears, or null if the vertex is detached.
 void detach()
          Detach this vertex from the node (if any) in which it appears.
 byte[] getBytes()
          Retrieve the binary value of this vertex.
 double getDouble()
          Retrieve the double (64 bit floating point) value of this vertex.
 int getGeneration()
          Retrieve the generation of the storage containing this vertex.
 int getIndex()
          Retrieve the vertexIndex field for this vertex, which is a unique (within its storage) value identifying its underlying e4Graph vertex.
 int getInt()
          Retrieve the integer value of this vertex.
 com.e4graph.Node getNode()
          Retrieve the Node value of this vertex.
 com.e4graph.Node getRootNode()
          Retrieve a Node object for the currently designated root node of the storage containing this vertex.
 com.e4graph.Storage getStorage()
          Retrieve a Storage for the storage containing this vertex.
 int getStorageIndex()
          Retrieve the storageIndex field for this vertex, which is a unique value identifying the storage containing this vertex.
 java.lang.String getString()
          Retrieve the String value of this vertex.
 int getUserData()
          Retrieve an arbitrary integer value associated with this vertex by the user program.
 com.e4graph.Value getValue()
          Retrieve the value of this vertex without a-priori knowing the type of the value.
 boolean isDetached()
          A vertex is detached if it is not contained in any node.
 boolean isValid()
          A vertex is valid if neither its vertexIndex and storageIndex are the constant value INVALID, and the underlying e4Graph vertex is valid.
 void moveVertex(com.e4graph.Vertex v, int io, int offset)
          Move the given vertex to the position specified by the insert order io and the given offset relative to this vertex, in the node containing this vertex.
 java.lang.String name()
          Retrieve the name of this vertex.
 com.e4graph.Vertex next(int n)
          Retrieve the next vertex after this one in the node containing this vertex, or null if there's none or if this vertex is detached.
 com.e4graph.Vertex prev(int n)
          Retrieve the previous vertex before this one in the node containing this vertex, or null if there's none or if this vertex is detached.
 int rank()
          Retrieve the rank of this vertex in the node in which it appears.
 java.lang.String rename(java.lang.String newname)
          Rename this vertex to another name.
 void set(byte[] bs)
          Set the value of this vertex to the binary value bs.
 void set(double d)
          Set the value of this vertex to the double (64 bit floatin point) value d.
 void set(int v)
          Set the value of this vertex to the integer value v.
 void set(com.e4graph.Node n)
          Set the value of this vertex to the Node n.
 void set(java.lang.String s)
          Set the value of this vertex to the String s.
 com.e4graph.Node setNode()
          Set the value of this vertex to a new node and return the Node object representing the new node.
 void setUserData(int userData)
          Persistently associate an arbitrary integer value with this vertex.
 int type()
          Retrieve the type of the value of this vertex.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVALID

public static final int INVALID
This value represents the vertexIndex for an invalid vertex.

See Also:
Constant Field Values

ILLEGAL

public static final int ILLEGAL
ILLEGAL is a possible value for the type of the value of a vertex, denoting an illegal value type.

See Also:
Constant Field Values

NODE

public static final int NODE
NODE is a possible value for the type of the value of a vertex, denoting a value of type com.e4graph.Node.

See Also:
Constant Field Values

INTEGER

public static final int INTEGER
INTEGER is a possible value for the type of the value of a vertex, denoting an integer value type.

See Also:
Constant Field Values

DOUBLE

public static final int DOUBLE
DOUBLE is a possible value for the type of the value of a vertex, denoting a double (64 bit floating point) value.

See Also:
Constant Field Values

STRING

public static final int STRING
STRING is a possible value for the type of the value of a vertex, denoting a java.lang.String value.

See Also:
Constant Field Values

BYTES

public static final int BYTES
BYTES is a possible value for the type of the value of a vertex, denoting a value of type array of byte.

See Also:
Constant Field Values
Method Detail

getIndex

public int getIndex()
Retrieve the vertexIndex field for this vertex, which is a unique (within its storage) value identifying its underlying e4Graph vertex.


getStorageIndex

public int getStorageIndex()
Retrieve the storageIndex field for this vertex, which is a unique value identifying the storage containing this vertex.


getGeneration

public int getGeneration()
Retrieve the generation of the storage containing this vertex.


isValid

public boolean isValid()
A vertex is valid if neither its vertexIndex and storageIndex are the constant value INVALID, and the underlying e4Graph vertex is valid.


getInt

public int getInt()
           throws IncorrectVertexTypeException
Retrieve the integer value of this vertex.

IncorrectVertexTypeException

getDouble

public double getDouble()
                 throws IncorrectVertexTypeException
Retrieve the double (64 bit floating point) value of this vertex.

IncorrectVertexTypeException

getString

public java.lang.String getString()
                           throws IncorrectVertexTypeException
Retrieve the String value of this vertex.

IncorrectVertexTypeException

getBytes

public byte[] getBytes()
                throws IncorrectVertexTypeException
Retrieve the binary value of this vertex.

IncorrectVertexTypeException

getNode

public com.e4graph.Node getNode()
                         throws IncorrectVertexTypeException
Retrieve the Node value of this vertex.

IncorrectVertexTypeException

getValue

public com.e4graph.Value getValue()
                           throws IncorrectVertexTypeException
Retrieve the value of this vertex without a-priori knowing the type of the value.

IncorrectVertexTypeException

set

public void set(int v)
Set the value of this vertex to the integer value v.


set

public void set(double d)
Set the value of this vertex to the double (64 bit floatin point) value d.


set

public void set(java.lang.String s)
Set the value of this vertex to the String s.


set

public void set(byte[] bs)
Set the value of this vertex to the binary value bs.


set

public void set(com.e4graph.Node n)
Set the value of this vertex to the Node n.


setNode

public com.e4graph.Node setNode()
Set the value of this vertex to a new node and return the Node object representing the new node.


rank

public int rank()
Retrieve the rank of this vertex in the node in which it appears.


detach

public void detach()
Detach this vertex from the node (if any) in which it appears.


isDetached

public boolean isDetached()
A vertex is detached if it is not contained in any node.


type

public int type()
Retrieve the type of the value of this vertex.


name

public java.lang.String name()
Retrieve the name of this vertex.


rename

public java.lang.String rename(java.lang.String newname)
Rename this vertex to another name.


getRootNode

public com.e4graph.Node getRootNode()
Retrieve a Node object for the currently designated root node of the storage containing this vertex.


getStorage

public com.e4graph.Storage getStorage()
                               throws StorageIsNotOpenException
Retrieve a Storage for the storage containing this vertex.

StorageIsNotOpenException

containingNode

public com.e4graph.Node containingNode()
Retrieve the node in which this vertex appears, or null if the vertex is detached.


moveVertex

public void moveVertex(com.e4graph.Vertex v,
                       int io,
                       int offset)
                throws InvalidPositionException
Move the given vertex to the position specified by the insert order io and the given offset relative to this vertex, in the node containing this vertex.

InvalidPositionException

next

public com.e4graph.Vertex next(int n)
                        throws NoSuchVertexException
Retrieve the next vertex after this one in the node containing this vertex, or null if there's none or if this vertex is detached.

NoSuchVertexException

prev

public com.e4graph.Vertex prev(int n)
                        throws NoSuchVertexException
Retrieve the previous vertex before this one in the node containing this vertex, or null if there's none or if this vertex is detached.

NoSuchVertexException

getUserData

public int getUserData()
Retrieve an arbitrary integer value associated with this vertex by the user program.


setUserData

public void setUserData(int userData)
Persistently associate an arbitrary integer value with this vertex.