net.sourceforge.e4graph
Interface Marker


public interface Marker

The Marker class provides the abstraction of a persistent named marker. A marker is associated with a storage: the Marker class provides a method to retrieve an instance of Storage that represents the associated storage. A marker marks a specific node, its marked node. Each marker is identified by a name that is required to be unique within the containing storage; each marker is also identified by a unique integer identifier.

More than one marker may mark a specific node. A node is reachable if it is marked by one or more markers, or if it is reachable from a marked node, recursively. The Marker class provides methods to retrieve the marked node and to reuse this marker to mark another node.

Author:
Ryan Shaw

Method Summary
 void close()
          Releases a marker's resources and closes it immediately.
 void delete()
          Deletes the underlying storage occupied by this marker in its associated storage and recursively deletes nodes and vertices that become unreachable as a result of the deletion.
 Node getMarkedNode()
          Returns the node marked by this marker.
 java.lang.String getName()
          Returns the name with which this marker was created.
 Storage getStorage()
          Returns the storage associated with this marker.
 int getUniqueID()
          Returns the integer that uniquely identifies this marker within its associated storage.
 boolean isClosed()
          Tests to see if a marker is closed.
 void setMarkedNode(Node n)
          Sets the node marked by this marker to n.
 

Method Detail

getName

public java.lang.String getName()
                         throws E4GraphException
Returns the name with which this marker was created.
Returns:
the name of this marker
Throws:
E4GraphException - if an error occurs

getStorage

public Storage getStorage()
                   throws E4GraphException
Returns the storage associated with this marker.
Returns:
the storage associated with this marker
Throws:
E4GraphException - if an error occurs

getMarkedNode

public Node getMarkedNode()
                   throws E4GraphException
Returns the node marked by this marker.
Returns:
the node marked by this marker
Throws:
E4GraphException - if an error occurs

setMarkedNode

public void setMarkedNode(Node n)
                   throws E4GraphException
Sets the node marked by this marker to n. The node previously marked by this marker may now be unreachable. If so, it is closed and deleted.
Parameters:
n - the new node to be marked by this marker
Throws:
E4GraphException - if an error occurs

getUniqueID

public int getUniqueID()
                throws E4GraphException
Returns the integer that uniquely identifies this marker within its associated storage.
Returns:
this marker's unique ID
Throws:
E4GraphException - if an error occurs

delete

public void delete()
            throws E4GraphException
Deletes the underlying storage occupied by this marker in its associated storage and recursively deletes nodes and vertices that become unreachable as a result of the deletion. Any instances of this marker or nodes and vertices that became unreachable are closed and deleted.
Throws:
E4GraphException - if an error occurs

isClosed

public boolean isClosed()
Tests to see if a marker is closed.
Returns:
true if the marker is closed; false if it's still open

close

public void close()
Releases a marker's resources and closes it immediately.


Copyright (c) 2001, Silver Egg Technology Co., Ltd.