org.purl.xnode
Interface XNodeLink

All Superinterfaces:
XNodeID

public interface XNodeLink
extends XNodeID

XNodeLink extends XNodeID as a link or reference to an XNode. The only fundamental augmentation is the ability set and get the link strength, which is represented as a double value from 0 to 1.0. Just as with XNodeIDs, XNodeLink objects should generally be created by a factory so that they are themselves unique within a JVM.

The XNode API (the package org.purl.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.

Since:
XNode 1.3
Version:
$Id: XNodeLink.java,v 3.1 2007-06-20 01:28:43 altheim Exp $
Author:
Murray Altheim

Field Summary
static double INVALID_WEIGHT
          The fixed weight value indicating an invalid weight.
static double MANUAL_LINK_WEIGHT
          This is also the default weight for manually-created XNodeLinks, establishing a direct link of maximum strength.
static double MAX_WEIGHT
          The maximum weight for XNodeLinks.
static double MIN_WEIGHT
          The minimum weight for XNodeLinks.
 
Method Summary
 String cid()
          Returns the Collection ID String.
 String getTitle()
          Returns the title of the link as a value between 0 and 1.0.
 double getWeight()
          Returns the weight of the link as a value between 0 and 1.0.
 String nid()
          Returns the Node ID String.
 void setTitle(String title)
          Sets the title of the link to a String title.
 void setWeight(double weight)
          Sets the weight of the link to the double value between 0 and 1.0.
 String toPathNameFragment()
          Returns a path name representation of this XNodeLink (as a String), for use in path name composition, such as in zip files or XNode serializations existing on file systems.
 String toString()
          Returns a String representation of this XNodeLink.
 String toURI()
          Returns a URI representation of this XNodeLink based on the root database URI, eg., ""xnode://db/cid/nid".
 

Field Detail

MIN_WEIGHT

static final double MIN_WEIGHT
The minimum weight for XNodeLinks. The value is 0.0.

See Also:
Constant Field Values

MAX_WEIGHT

static final double MAX_WEIGHT
The maximum weight for XNodeLinks. The value is 1.0.

See Also:
Constant Field Values

MANUAL_LINK_WEIGHT

static final double MANUAL_LINK_WEIGHT
This is also the default weight for manually-created XNodeLinks, establishing a direct link of maximum strength. This is the same value as the maximum weight since a manually-created link is considered as of maximum confidence, strength, or weight. The value is 1.0.

See Also:
Constant Field Values

INVALID_WEIGHT

static final double INVALID_WEIGHT
The fixed weight value indicating an invalid weight. This is used for links that (by some external definition) cannot have a weight, as well as an error condition. The value is -1.0.

See Also:
Constant Field Values
Method Detail

cid

String cid()
Returns the Collection ID String.

Specified by:
cid in interface XNodeID

nid

String nid()
Returns the Node ID String.

Specified by:
nid in interface XNodeID

setWeight

void setWeight(double weight)
               throws IllegalArgumentException
Sets the weight of the link to the double value between 0 and 1.0.

Throws:
IllegalArgumentException - on values outside the range of 0.0 to 1.0.

getWeight

double getWeight()
Returns the weight of the link as a value between 0 and 1.0.


setTitle

void setTitle(String title)
Sets the title of the link to a String title.


getTitle

String getTitle()
Returns the title of the link as a value between 0 and 1.0.


toPathNameFragment

String toPathNameFragment()
Returns a path name representation of this XNodeLink (as a String), for use in path name composition, such as in zip files or XNode serializations existing on file systems. This will consist of the collection ID, a "/" character followed by the Node ID (eg., "cid/nid").

Specified by:
toPathNameFragment in interface XNodeID
See Also:
XNodeID.toPathNameFragment()

toURI

String toURI()
Returns a URI representation of this XNodeLink based on the root database URI, eg., ""xnode://db/cid/nid".

Specified by:
toURI in interface XNodeID
Returns:
a URI (as a String).

toString

String toString()
Returns a String representation of this XNodeLink.

Specified by:
toString in interface XNodeID
Overrides:
toString in class Object


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.