i3.dragos.gm.core.id
Class GraphEntityID

java.lang.Object
  extended by i3.dragos.gm.core.id.GraphEntityID
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
EdgeID, GraphID, NodeID, RelationEndID, RelationID

public abstract class GraphEntityID
extends java.lang.Object
implements java.io.Serializable

A GraphEntityID is used to uniquely identify a graph entity.

The following two components are needed to identify a graph entity:

DataSourceURL
The DataSource where this graph entity is stored.
Internal ID
The internal ID is used to uniquely identify the graph in the data source where it is stored.

Additionally, the graph entity's type is also stored in this class. It is not needed or used to identify the graph! It is only stored in this class so it can be accessed more easily. See equals(Object)for more discussion on this.

The meta attributes of a graph entity and its ID are shared between them. See here for a discussion on this.

Author:
Boris Boehlen <boehlen@cs.rwth-aachen.de>, Thorsten Hermes <thermes@i3.informatik.rwth-aachen.de>
See Also:
Core Graph Model , Implementation Issues , Serialized Form

Constructor Summary
protected GraphEntityID(DataSourceURL dataSourceURL, java.io.Serializable internalIdentifier, GraphEntityClassID type)
          Constructs a new ID for a graph entity.
 
Method Summary
 boolean equals(java.lang.Object o)
          Checks for equality with another object.
 DataSourceURL getDataSourceURL()
          Returns the URL to the data source that stores the graph entity represented by this ID.
 GraphEntity getGraphEntity()
          Returns the graph entity referenced by this ID.
 GraphEntityClassID getGraphEntityClassID()
          Returns the graph entity's type.
 java.io.Serializable getInternalIdentifier()
          Returns the internal identifier used to uniquely identify this object in the storage backend.
 int hashCode()
          
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphEntityID

protected GraphEntityID(DataSourceURL dataSourceURL,
                        java.io.Serializable internalIdentifier,
                        GraphEntityClassID type)
                 throws java.lang.IllegalArgumentException
Constructs a new ID for a graph entity.

Parameters:
dataSourceURL - The URL of the data source where this Graph is stored.
internalIdentifier - Internal graph entity ID (given by the data source).
type - Type of the graph entity.
Throws:
java.lang.IllegalArgumentException - if dataSourceURL, id, or type is null.
Method Detail

getGraphEntity

public GraphEntity getGraphEntity()
                           throws DragosException
Returns the graph entity referenced by this ID.

Returns:
the graph entity referenced by this ID.
Throws:
DragosException - in case of internal errors.

getDataSourceURL

public final DataSourceURL getDataSourceURL()
Returns the URL to the data source that stores the graph entity represented by this ID. The returned value is guaranteed to not be null.

Returns:
the URL to the data source that stores the graph entity.

getInternalIdentifier

public final java.io.Serializable getInternalIdentifier()
Returns the internal identifier used to uniquely identify this object in the storage backend.

Returns:
the internal identifier.

getGraphEntityClassID

public final GraphEntityClassID getGraphEntityClassID()
Returns the graph entity's type. Since all graph entities are typed, this is never null.

Returns:
the graph entity's type.

equals

public boolean equals(java.lang.Object o)
Checks for equality with another object.

This object is considered equal if all of the following conditions are met:

Subclasses and implementations might want to extend this list by adding assertions comparing additional or internal data (e.g. the type of the graph entity). However, equality must only be determined by the above rules, preferably by using super.equals(o), and any difference in the additional data for two equal IDs is an error.

Overrides:
equals in class java.lang.Object
Parameters:
o - The Object to compare to.
Returns:
true if o is equal according to above rules, false otherwise.

hashCode

public final int hashCode()

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2002-2008 RWTH Aachen, Department of Computer Science 3 (Software Engineering). All Rights Reserved.