nz.ac.waikato.mcennis.rat.graph.link
Interface Link

All Superinterfaces:
java.lang.Comparable, Model, java.io.Serializable
All Known Implementing Classes:
BasicUserLink, DBLink

public interface Link
extends java.io.Serializable, java.lang.Comparable, Model

Interface for describing a link (arc, edge) in a graph.


Field Summary
static int ALL
           
static int DESTINATION
           
static int SOURCE
           
static int STRENGTH
           
static int TYPE
           
 
Method Summary
 void add(Property prop)
          Add the given property to this link
 Actor getDestination()
          Returns the actor where the link (edge, arc) terminates.
 Property[] getProperty()
          Return all properties associated with this link.
 Property getProperty(java.lang.String id)
          Get the property with the given name.
 Actor getSource()
          Returns the actor from which the link (edge, arc) begins.
 double getStrength()
          return the strength of this link.
 java.lang.String getType()
          Returns the type (relation) of the link.
 void set(Actor l, double strength, Actor r)
          sets all aspects of the link at once
 void set(double str)
          Sets the strength that this link has.
 void setDestination(Actor u)
          Sets the destination of this link.
 void setSource(Actor u)
          Sets the source of this link.
 void setType(java.lang.String type)
          Sets the type (relation) of the link.
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface nz.ac.waikato.mcennis.rat.graph.model.Model
addListener
 

Field Detail

ALL

static final int ALL
See Also:
Constant Field Values

SOURCE

static final int SOURCE
See Also:
Constant Field Values

DESTINATION

static final int DESTINATION
See Also:
Constant Field Values

STRENGTH

static final int STRENGTH
See Also:
Constant Field Values

TYPE

static final int TYPE
See Also:
Constant Field Values
Method Detail

getStrength

double getStrength()
return the strength of this link. This can be positive or negative or non-numeric values such as NaN, -Infinity, or Inifinity for links where only the existance of the link is important.

Returns:
strength of the link

getSource

Actor getSource()
Returns the actor from which the link (edge, arc) begins.

Returns:
source actor

getDestination

Actor getDestination()
Returns the actor where the link (edge, arc) terminates.

Returns:
destination actor

getType

java.lang.String getType()
Returns the type (relation) of the link.

Returns:
typer (relation) of this link.

set

void set(Actor l,
         double strength,
         Actor r)
sets all aspects of the link at once

Parameters:
l - source actor
strength - strength of this length
r - destination actor

setSource

void setSource(Actor u)
Sets the source of this link. This may not be null.

Parameters:
u - actor source

setDestination

void setDestination(Actor u)
Sets the destination of this link. This may not be null.

Parameters:
u - destination actor.

setType

void setType(java.lang.String type)
Sets the type (relation) of the link.

Parameters:
type - string describing the type

set

void set(double str)
Sets the strength that this link has. This may be a non-numeric value.

Parameters:
str - sterngth of this link.

add

void add(Property prop)
Add the given property to this link

Parameters:
prop -

getProperty

Property getProperty(java.lang.String id)
Get the property with the given name. Returns null if no property with that id exists.

Parameters:
id - id of the property to be returned
Returns:
property with the given id

getProperty

Property[] getProperty()
Return all properties associated with this link. Returns null if no properties are associated with this link.

Returns:
array of properties associated with this object.