|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nz.ac.waikato.mcennis.rat.graph.model.ModelShell nz.ac.waikato.mcennis.rat.graph.link.BasicUserLink
public class BasicUserLink
Class providing a base implementation of the Link Interface
Field Summary | |
---|---|
static long |
serialVersionUID
|
Fields inherited from class nz.ac.waikato.mcennis.rat.graph.model.ModelShell |
---|
listener |
Fields inherited from interface nz.ac.waikato.mcennis.rat.graph.link.Link |
---|
ALL, DESTINATION, SOURCE, STRENGTH, TYPE |
Constructor Summary | |
---|---|
BasicUserLink()
Creates a generic link with no source, destination, and a strength of -1.0. |
|
BasicUserLink(Actor source,
double strength,
Actor destination)
Creates a new instance of BasicLink in a self-consistent state |
Method Summary | |
---|---|
void |
add(Property prop)
Add the given property to this link |
int |
compareTo(java.lang.Object o)
|
boolean |
equals(java.lang.Object obj)
|
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 t)
Sets the type (relation) of the link. |
Methods inherited from class nz.ac.waikato.mcennis.rat.graph.model.ModelShell |
---|
addListener, fireChange |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface nz.ac.waikato.mcennis.rat.graph.model.Model |
---|
addListener |
Field Detail |
---|
public static final long serialVersionUID
Constructor Detail |
---|
public BasicUserLink()
public BasicUserLink(Actor source, double strength, Actor destination)
source
- source actor - may not be nullstrength
- link strengthdestination
- destination actor - may not be nullMethod Detail |
---|
public double getStrength()
Link
getStrength
in interface Link
public Actor getSource()
Link
getSource
in interface Link
public Actor getDestination()
Link
getDestination
in interface Link
public void set(Actor l, double strength, Actor r)
Link
set
in interface Link
l
- source actorstrength
- strength of this lengthr
- destination actorpublic java.lang.String getType()
Link
getType
in interface Link
public void setType(java.lang.String t)
Link
setType
in interface Link
t
- string describing the typepublic void setSource(Actor u)
Link
setSource
in interface Link
u
- actor sourcepublic void setDestination(Actor u)
Link
setDestination
in interface Link
u
- destination actor.public void set(double str)
Link
set
in interface Link
str
- sterngth of this link.public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public void add(Property prop)
Link
add
in interface Link
public Property getProperty(java.lang.String id)
Link
getProperty
in interface Link
id
- id of the property to be returned
public Property[] getProperty()
Link
getProperty
in interface Link
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |