|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.xnode.XNodeIDFactory
public class XNodeIDFactory
A factory for creating XNodeIDs and XNodeLinks.
XNodeID provides a common, convenient identifier for XNodes, combining an immutable Collection ID (cid) and Node ID (nid) and a method for obtaining the database URL reference.
Whereas XNodeID is an identifier, XNodeLink extends XNodeID as a link or reference to an XNode. An important augmentation is the ability to set and get the link strength, which is represented as a double value from 0.0D to 1.0D. Also note: XNodeLinks are not cached.
The XNodeIDFactory is a singleton class that provides a means of guaranteeing that for any combination of Collection and Node ID that a single XNodeID is created. Calling either of the two public getXNodeID() methods prior to instantiation causes the factory to be created.
TODO: have not yet implemented XNodeID caching/uniqueness guarantees, apart from those provided natively by the Hashtable.
The XNode Implementation (the package org.ceryle.xnode.*, both its source code and documentation), are released under the Apache 2.0 License. For more details, check the LICENSE file contained with the distribution, or see The Ceryle Project for more information. It is distributed with no warranty.
XNode| Method Summary | |
|---|---|
static XNodeID |
getXNodeID(String[] ids)
Constructor with a String array ids. |
static XNodeID |
getXNodeID(String cid,
String nid)
Returns an XNodeID provided with the Collection and Node IDs. |
static XNodeLink |
getXNodeLink(String cid,
String nid,
double weight)
Returns an XNodeLink provided with the Collection and Node IDs, and weight. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static XNodeID getXNodeID(String[] ids)
throws XNodeException
This is guaranteed to return the same Object for the same IDs.
ids - a String array containing the Collection and Node IDs, resp.
XNodeException - if either array element 0 or 1 is null or not an XML Name.
public static XNodeID getXNodeID(String cid,
String nid)
throws XNodeException
This is guaranteed to return the same Object for the same IDs.
cid - the Collection ID.nid - the Node ID.
XNodeException - if either parameter is null or not an XML Name.
public static XNodeLink getXNodeLink(String cid,
String nid,
double weight)
throws XNodeException
Unlike XNodeIDs, XNodeLinks are not cached.
cid - the Collection ID.nid - the Node ID.weight - the link weight between 0.0 and 1.0.
XNodeException - if either of the cid or nid parameters
is null or not an XML Name or the weight is out
of range.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||