|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Storage
class provides persistent storage of markers
and elements reachable from those markers. A user application may have
any number of storages open at a given time, limited only by the available
machine resources.
Field Summary | |
static int |
BINARY_SPACE
|
static int |
FLOAT_SPACE
|
static int |
INT_SPACE
|
static int |
MARKER_SPACE
|
static int |
NAME_SPACE
|
static int |
NODE_SPACE
|
static int |
SPACE_ALLOC
|
static int |
SPACE_AVAIL
|
static int |
SPACE_FREED
|
static int |
SPACE_USED
|
static int |
STRING_SPACE
|
static int |
VERTEX_SPACE
|
Method Summary | |
void |
addMarkerAdditionListener(MarkerAdditionListener l)
Adds the specified marker addition listener to receive marker addition events from this storage. |
void |
addMarkerDeletionListener(MarkerDeletionListener l)
Adds the specified marker deletion listener to receive marker deletion events from this storage. |
void |
addNodeAdditionListener(NodeAdditionListener l)
Adds the specified node addition listener to receive node addition events from this storage. |
void |
addNodeDeletionListener(NodeDeletionListener l)
Adds the specified node deletion listener to receive node deletion events from this storage. |
void |
addVertexAdditionListener(VertexAdditionListener l)
Adds the specified vertex addition listener to receive vertex addition events from this storage. |
void |
addVertexDeletionListener(VertexDeletionListener l)
Adds the specified vertex deletion listener to receive vertex deletion events from this storage. |
void |
addVertexModificationListener(VertexModificationListener l)
Adds the specified vertex modification listener to receive vertex modification events from this storage. |
void |
close()
Releases a storage's resources and closes it immediately, committing if necessary. |
void |
commit()
Commits any changes that have been made to the storage immediately. |
boolean |
containsMarker(java.lang.String name)
Returns true if a marker with the specified name exists in this storage. |
void |
copyInto(Storage otherStorage,
boolean forceCommit)
Copies the contents of the receiver to otherStorage . |
void |
delete()
Deletes the underlying storage. |
boolean |
getAutoCommit()
Gets the current auto-commit state. |
java.lang.String |
getDriver()
Returns the name of the driver used to open this storage, or null if the storage is closed. |
Node |
getMarkedNode(java.lang.String name)
Returns the node marked by the marker with the specified name. |
Marker |
getMarker(long id)
Returns the marker with the specified unique ID if it exists, otherwise returns null. |
Marker |
getMarker(java.lang.String name)
Returns the marker with the specified name if it exists, otherwise returns null. |
int |
getMarkerCount()
Returns the number of markers existing within this storage. |
java.lang.String |
getName()
Returns the name of the storage, or null if the storage is closed. |
Node |
getNode(long id)
Returns the node with the specified unique ID if it exists, otherwise returns null. |
int |
getStatistic(int space,
int stat)
Retrieves statistics about the use of various allocation spaces within a storage. |
Vertex |
getVertex(long id)
Returns the vertex with the specified unique ID if it exists, otherwise returns null. |
boolean |
isClosed()
Tests to see if a storage is closed. |
boolean |
isDirty()
Returns truetrue if there are uncommitted modifications to this storage; otherwise returns false. |
boolean |
isEmpty()
Returns true if the storage is empty, that is, it contains no markers or other elements. |
void |
markDirty()
Marks the storage as dirty, i.e. |
java.util.Iterator |
markers()
Returns an iterator over all the markers in this storage. |
java.util.Iterator |
nodes()
Returns an iterator over all the nodes in this storage. |
void |
removeAll()
Removes all markers and elements reachable from those markers from this storage. |
void |
removeMarkerAdditionListener(MarkerAdditionListener l)
Removes the specified marker addition listener so that it no longer receives marker addition events from this storage. |
void |
removeMarkerDeletionListener(MarkerDeletionListener l)
Removes the specified marker deletion listener so that it no longer receives marker deletion events from this storage. |
void |
removeNodeAdditionListener(NodeAdditionListener l)
Removes the specified node addition listener so that it no longer receives node addition events from this storage. |
void |
removeNodeDeletionListener(NodeDeletionListener l)
Removes the specified node deletion listener so that it no longer receives node deletion events from this storage. |
void |
removeVertexAdditionListener(VertexAdditionListener l)
Removes the specified vertex addition listener so that it no longer receives vertex addition events from this storage. |
void |
removeVertexDeletionListener(VertexDeletionListener l)
Removes the specified vertex deletion listener so that it no longer receives vertex deletion events from this storage. |
void |
removeVertexModificationListener(VertexModificationListener l)
Removes the specified vertex modification listener so that it no longer receives vertex modification events from this storage. |
void |
setAutoCommit(boolean autoCommit)
Sets this storage's auto-commit mode. |
java.util.Iterator |
vertices()
Returns an iterator over all the vertices in this storage. |
java.util.Iterator |
vertices(VertexFilter filter)
Returns an iterator over vertices in this storage accepted by the specified filter. |
Field Detail |
public static final int MARKER_SPACE
public static final int NODE_SPACE
public static final int VERTEX_SPACE
public static final int NAME_SPACE
public static final int STRING_SPACE
public static final int INT_SPACE
public static final int FLOAT_SPACE
public static final int BINARY_SPACE
public static final int SPACE_USED
public static final int SPACE_AVAIL
public static final int SPACE_FREED
public static final int SPACE_ALLOC
Method Detail |
public void setAutoCommit(boolean autoCommit)
autoCommit
- true enables auto-commit; false
disables auto-commit.public boolean getAutoCommit()
public void commit() throws E4GraphException
E4GraphException
- if an error occurspublic void delete() throws E4GraphException
E4GraphException
- if an error occurspublic boolean isClosed()
public void close() throws E4GraphException
E4GraphException
- if an error occurspublic void copyInto(Storage otherStorage, boolean forceCommit) throws E4GraphException
otherStorage
. The
previous contents of otherStorage are deleted, and no events are fired
because of the deletion. If forceCommit
is true,
otherStorage
will be be committed after the copy is done.
After this operation, the contents of this storage and
otherStorage
are identical. Changes made to one storage
after the copy are not reflected in the other storage.
Listeners registered with otherStorage
stay in effect and
may be called when events fire after the copy, if changes are made to
otherStorage
.
otherStorage
- the storage into which the contents of this storage
will be copiedforceCommit
- whether or not to commit the other storage after the
copyE4GraphException
- if an error occurspublic boolean isDirty()
public void markDirty()
public int getMarkerCount()
public boolean containsMarker(java.lang.String name)
name
- name of the marker to look forpublic Marker getMarker(java.lang.String name) throws E4GraphException
name
- name of the marker to returnE4GraphException
- if an error occurspublic Marker getMarker(long id) throws E4GraphException
id
- a valid unique IDE4GraphException
- if an error occurspublic Node getMarkedNode(java.lang.String name) throws E4GraphException
name
- name of the marker to return or createE4GraphException
- if an error occurspublic Node getNode(long id) throws E4GraphException
id
- a valid unique IDE4GraphException
- if an error occurspublic Vertex getVertex(long id) throws E4GraphException
id
- a valid unique IDE4GraphException
- if an error occurspublic java.util.Iterator markers()
public java.util.Iterator nodes()
public java.util.Iterator vertices()
public java.util.Iterator vertices(VertexFilter filter)
filter
- visit only vertices accepted by this filterpublic java.lang.String getName()
public java.lang.String getDriver()
public boolean isEmpty()
public void removeAll() throws E4GraphException
E4GraphException
- if an error occurspublic int getStatistic(int space, int stat) throws E4GraphException
space
- the allocation space we are interested instat
- the specific kind of statistic desiredE4GraphException
- if an error occurspublic void addMarkerAdditionListener(MarkerAdditionListener l)
l
- the marker addition listenerMarkerAdditionListener
,
removeMarkerAdditionListener(net.sourceforge.e4graph.MarkerAdditionListener)
public void removeMarkerAdditionListener(MarkerAdditionListener l)
l
- the marker addition listenerMarkerAdditionListener
,
addMarkerAdditionListener(net.sourceforge.e4graph.MarkerAdditionListener)
public void addMarkerDeletionListener(MarkerDeletionListener l)
l
- the marker deletion listenerMarkerDeletionListener
,
removeMarkerDeletionListener(net.sourceforge.e4graph.MarkerDeletionListener)
public void removeMarkerDeletionListener(MarkerDeletionListener l)
l
- the marker deletion listenerMarkerDeletionListener
,
addMarkerDeletionListener(net.sourceforge.e4graph.MarkerDeletionListener)
public void addNodeAdditionListener(NodeAdditionListener l)
l
- the node addition listenerNodeAdditionListener
,
removeNodeAdditionListener(net.sourceforge.e4graph.NodeAdditionListener)
public void removeNodeAdditionListener(NodeAdditionListener l)
l
- the node addition listenerNodeAdditionListener
,
addNodeAdditionListener(net.sourceforge.e4graph.NodeAdditionListener)
public void addNodeDeletionListener(NodeDeletionListener l)
l
- the node deletion listenerNodeDeletionListener
,
removeNodeDeletionListener(net.sourceforge.e4graph.NodeDeletionListener)
public void removeNodeDeletionListener(NodeDeletionListener l)
l
- the node deletion listenerNodeDeletionListener
,
addNodeDeletionListener(net.sourceforge.e4graph.NodeDeletionListener)
public void addVertexAdditionListener(VertexAdditionListener l)
l
- the vertex addition listenerVertexAdditionListener
,
removeVertexAdditionListener(net.sourceforge.e4graph.VertexAdditionListener)
public void removeVertexAdditionListener(VertexAdditionListener l)
l
- the vertex addition listenerVertexAdditionListener
,
addVertexAdditionListener(net.sourceforge.e4graph.VertexAdditionListener)
public void addVertexModificationListener(VertexModificationListener l)
l
- the vertex modification listenerVertexModificationListener
,
removeVertexModificationListener(net.sourceforge.e4graph.VertexModificationListener)
public void removeVertexModificationListener(VertexModificationListener l)
l
- the vertex modification listenerVertexModificationListener
,
addVertexModificationListener(net.sourceforge.e4graph.VertexModificationListener)
public void addVertexDeletionListener(VertexDeletionListener l)
l
- the vertex deletion listenerVertexDeletionListener
,
removeVertexDeletionListener(net.sourceforge.e4graph.VertexDeletionListener)
public void removeVertexDeletionListener(VertexDeletionListener l)
l
- the vertex deletion listenerVertexDeletionListener
,
addVertexDeletionListener(net.sourceforge.e4graph.VertexDeletionListener)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |