|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpl.edu.agh.cast.model.mapper.Link
public class Link
The link represents the raw connection between nodes in the base model.
Constructor Summary | |
---|---|
Link(long srcId,
long dstId,
String name,
int priority)
Lazy binding constructor. |
|
Link(Map args)
Creates the link from key : value pairs. |
|
Link(Node src,
Node dst,
String name,
int priority)
Creates the link from given set of attributes. |
|
Link(Node src,
Node dst,
String name,
Priority priority)
|
|
Link(Node src,
Node dst,
String name,
Priority priority,
String srcAccessor,
String dstAccessor)
|
|
Link(Node src,
Node dst,
String name,
Priority priority,
String srcAcc,
String dstAcc,
int srcPosition,
int dstPosition)
|
Method Summary | |
---|---|
boolean |
equals(Object other)
|
static Link |
find(Link link)
Find link which is equal to given link. |
static Link |
find(long linkId)
Find link with given id of null if not present. |
static List<Link> |
findWithDst(long nodeId)
Find all link whose destination is a node with given id. |
static List<Link> |
findWithSrc(long nodeId)
Find all link whose source is a node with given id. |
Node |
getDst()
Destination node getter. |
String |
getDstAccessor()
Returns the name of the destination node accessor method. |
long |
getDstId()
The destination id getter. |
int |
getDstPosition()
The position of destination node among other nodes at the destination side of the relationship (set of links). |
long |
getId()
DB indentifier reader. |
String |
getName()
Name getter. |
int |
getPriority()
Priority reader. |
Node |
getSrc()
Source node getter. |
String |
getSrcAccessor()
Returns the name of the source node accessor method. |
long |
getSrcId()
The source id getter. |
int |
getSrcPosition()
The position of source node among other nodes at the source side of the relationship (set of links). |
int |
hashCode()
The hash code. |
boolean |
save()
Save given metamodel link in the DB. |
void |
setDst(Node dst)
Destination setter. |
void |
setDstAccessor(String accessor)
Target accessor setter. |
void |
setDstPosition(int position)
The target position setter. |
void |
setId(long newId)
Id setter. |
void |
setPriority(int newPriority)
Priority setter. |
void |
setPriority(Object priority)
Priority setter (tries to translate given object to priority). |
void |
setSaved(boolean newSaved)
Saved flag setter. |
void |
setSrc(Node srcNode)
Source setter. |
void |
setSrcAccessor(String accessor)
Source accessor setter. |
void |
setSrcPosition(int position)
|
static void |
stats()
Print out the stats of the link cache. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Link(Map args)
args
- the map of key : value pairs.public Link(Node src, Node dst, String name, int priority)
src
- The source of the linkdst
- The target of the linkname
- The name of the linkpriority
- The priority of the linkpublic Link(long srcId, long dstId, String name, int priority)
srcId
- The id of the source nodedstId
- The id of the destination nodename
- The name of the linkpriority
- The priority of the linkpublic Link(Node src, Node dst, String name, Priority priority, String srcAccessor, String dstAccessor)
public Link(Node src, Node dst, String name, Priority priority)
public Link(Node src, Node dst, String name, Priority priority, String srcAcc, String dstAcc, int srcPosition, int dstPosition)
Method Detail |
---|
public boolean save()
The saving process is recursive. Source and destination nodes are saved first and then the link is saved.
public int getPriority()
public void setPriority(int newPriority)
newPriority
- priority valuepublic void setPriority(Object priority)
priority
- priority valuepublic Node getDst()
public long getDstId()
public Node getSrc()
public long getSrcId()
public long getId()
public String toString()
toString
in class Object
Object.toString()
public String getName()
public void setSrc(Node srcNode)
srcNode
- Node to be set as source of the linkpublic void setDst(Node dst)
dst
- Node to be set as desitintion of the linkpublic boolean equals(Object other)
equals
in class Object
Object.equals(java.lang.Object)
public static Link find(long linkId)
linkId
- The id of the link
public void setSrcPosition(int position)
public int getSrcPosition()
public void setDstPosition(int position)
position
- The position to set.public int getDstPosition()
public int hashCode()
hashCode
in class Object
public String getSrcAccessor()
public String getDstAccessor()
public void setSaved(boolean newSaved)
newSaved
- New saved value.public void setId(long newId)
newId
- New idpublic void setSrcAccessor(String accessor)
accessor
- The source accessor.public void setDstAccessor(String accessor)
accessor
- The target accessor.public static Link find(Link link)
link
- The link which is used as the query example.
public static List<Link> findWithSrc(long nodeId) throws SQLException
nodeId
- The id of the source node
SQLException
public static List<Link> findWithDst(long nodeId) throws SQLException
nodeId
- The id of the destination node
SQLException
public static void stats()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |