|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.reades.mapthing.Link
public class Link
A simple link class that holds references to two Node objects. You would usually want to extend this class to do something more clever around weighting and such, but the idea here is that this class is easier to work with in Processing and allows us to implement zoom and pan without too much effort.
Node
,
Serialized FormField Summary | |
---|---|
boolean |
DEBUG
|
Constructor Summary | |
---|---|
Link(int id,
Node n1,
Node n2)
Constructor takes two SimpleNode (or extensions of SimpleNode) objects and stores them for later retrieval. |
|
Link(int id,
Node n1,
Node n2,
double val)
Create a Link object |
|
Link(int id,
Node n1,
Node n2,
double val,
String nm)
Create a Link object |
|
Link(int id,
Node n1,
Node n2,
String nm)
Constructor takes two SimpleNode (or extensions of SimpleNode) objects and stores them for later retrieval. |
Method Summary | |
---|---|
int |
getId()
Get the id of the link |
String |
getName()
Get the name of the link |
Node |
getNode1()
Get the first node |
Node |
getNode2()
Get the second node |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean DEBUG
Constructor Detail |
---|
public Link(int id, Node n1, Node n2)
id
- a unique id for the linkn1
- the origin node of the linkn2
- the destination node of the linkpublic Link(int id, Node n1, Node n2, String nm)
id
- a unique id for the linkn1
- the origin node of the linkn2
- the destination node of the linknm
- a name for the link (if using labels)public Link(int id, Node n1, Node n2, double val)
id
- a unique identifier for the linkn1
- the origin node for the linkn2
- the destination node for the linkval
- a link weight/valuepublic Link(int id, Node n1, Node n2, double val, String nm)
id
- a unique identifier for the linkn1
- the origin node for the linkn2
- the destination node for the linkval
- a link weight/valuenm
- a name for the link (if labelling)Method Detail |
---|
public int getId()
public String getName()
public Node getNode1()
Node
public Node getNode2()
Node
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |