i3.dragos.gm.core.id
Class GraphID

java.lang.Object
  extended by i3.dragos.gm.core.id.GraphEntityID
      extended by i3.dragos.gm.core.id.GraphID
All Implemented Interfaces:
java.io.Serializable

public class GraphID
extends GraphEntityID

A GraphID is used to uniquely identify a graph.

Extending GraphEntityID, this class also stores a graph's name. Only top-level graphs have a name, and null is returned for all other graphs.

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
GraphID(DataSourceURL dataSourceURL, java.io.Serializable internalIdentifier, GraphClassID type, java.lang.String name)
          Constructs a new ID representing a graph.
 
Method Summary
 boolean equals(java.lang.Object o)
          Checks for equality with another object.
 Graph getGraph()
          Returns the graph referenced by this ID.
 GraphClassID getGraphClassID()
          Returns the type of the graph.
 java.lang.String getName()
          Returns the name of the graph.
 
Methods inherited from class i3.dragos.gm.core.id.GraphEntityID
getDataSourceURL, getGraphEntity, getGraphEntityClassID, getInternalIdentifier, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphID

public GraphID(DataSourceURL dataSourceURL,
               java.io.Serializable internalIdentifier,
               GraphClassID type,
               java.lang.String name)
Constructs a new ID representing a graph.

Parameters:
dataSourceURL - The URL of the data source where this Graph is stored.
internalIdentifier - Internal graph ID (given by the data source).
type - Type of the graph.
name - Name of this graph for top level graphs, otherwise null.
Method Detail

getGraph

public Graph getGraph()
               throws DragosException
Returns the graph referenced by this ID.

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

getGraphClassID

public GraphClassID getGraphClassID()
Returns the type of the graph.

Actually, this method is just a correctly typed wrapper for calling GraphEntityID.getGraphEntityClassID().

Returns:
the graph class ID.

getName

public java.lang.String getName()
Returns the name of the graph.

Returns:
the name of the graph.

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 GraphEntityID
Parameters:
o - The Object to compare to.
Returns:
true if o is equal according to above rules, false otherwise.


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