|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectse.rupy.memory.NodeBean
se.rupy.sprout.Node
public class Node
The node is the atomic persistence object.
The graph will be inserted upon update() or in real-time
upon add(Node) and add(Data) if the parent node
is already inserted, so that the state doesen't have to be selected
from the database when the node is updated.
| Field Summary | |
|---|---|
static java.util.HashMap |
cache
|
static byte |
CHILD
|
static byte |
META
|
static byte |
PARENT
|
static byte |
POLL
|
| Fields inherited from interface se.rupy.sprout.Type |
|---|
ALL, ARTICLE, ARTICLE_BODY, ARTICLE_RATING, ARTICLE_READ, ARTICLE_TITLE, ARTICLE_TYPE, COMMENT, COMMENT_BODY, COMMENT_IP, COMMENT_STATE, FILE, FILE_NAME, FILE_TYPE, GROUP, GROUP_NAME, LABEL, LABEL_NAME, PING, PING_STATE, PING_TITLE, PING_URL, USER, USER_BIRTHDAY, USER_COUNTRY, USER_FIRST_NAME, USER_GENDER, USER_IP, USER_KEY, USER_LAST_NAME, USER_MAIL, USER_NAME, USER_PASS, USER_SHOW, USER_STATE |
| Constructor Summary | |
|---|---|
Node(int type)
The node type should be a bit identifiable integer this limits the number of node types to 32. |
|
| Method Summary | |
|---|---|
void |
add(Data data)
Add meta-data. |
void |
add(Node node)
Add child node. |
void |
add(short type,
java.lang.String value)
Add meta-data. |
java.util.LinkedList |
child(int type)
Get child nodes of a certain type. |
Node |
child(int link,
short meta,
java.lang.String value)
Return the first child that contains the meta-data. |
Node |
child(long id)
Get child node. |
boolean |
child(Node parent)
Is the node child of parent. |
double |
count(short type)
|
java.lang.String |
date()
|
boolean |
delete(byte what)
Deletes the node, it's meta-data, parent and/or child relations. |
java.lang.String |
encoded()
|
boolean |
fill(int depth,
int start,
int limit)
Fills the node with meta-data and children nodes. |
boolean |
link(int start,
int limit)
Fills the node with children nodes. |
boolean |
meta()
Fills the node with meta-data. |
Data |
meta(short type)
Get meta-data. |
Node |
parent(int type)
Return the first parent of a type. |
Node |
parent(int type,
Data data,
int limit)
Return the first parent of a type that contains the meta-data. |
boolean |
parent(Node child)
Is the node parent of child. |
java.lang.String |
path()
|
boolean |
poll(short type)
|
boolean |
poll(short type,
int increment)
|
boolean |
query(Data data)
Find data/node meta relation where type = value. |
boolean |
query(long id)
Find node. |
boolean |
query(short type,
java.lang.Object value)
Find data/node meta relation where type = value. |
void |
remove(Data data)
Remove the meta-data. |
void |
remove(Node node)
Remove the child node. |
boolean |
remove(short type)
|
java.lang.String |
safe(short type)
Get meta-data safely. |
java.lang.String |
time()
|
java.lang.String |
toString()
|
java.lang.String |
toXML(int padding)
|
void |
update()
Inserts or updates the node, it's meta-data and children nodes recursively. |
| Methods inherited from class se.rupy.memory.NodeBean |
|---|
copy, equals, getDate, getId, getType, key, read, setDate, setId, setType, synapse, write |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static java.util.HashMap cache
public static final byte PARENT
public static final byte CHILD
public static final byte META
public static final byte POLL
| Constructor Detail |
|---|
public Node(int type)
type - | Method Detail |
|---|
public void add(Node node)
throws java.sql.SQLException
node -
java.sql.SQLException
public void remove(Node node)
throws java.sql.SQLException
node -
java.sql.SQLException
public void add(short type,
java.lang.String value)
throws java.sql.SQLException
type - value -
java.sql.SQLException
public void add(Data data)
throws java.sql.SQLException
data -
java.sql.SQLException
public void remove(Data data)
throws java.sql.SQLException
data -
java.sql.SQLException
public boolean delete(byte what)
throws java.sql.SQLException
what - PARENT, CHILD and/or META
java.sql.SQLException
public void update()
throws java.sql.SQLException
java.sql.SQLException
public boolean query(long id)
throws java.sql.SQLException
id -
java.sql.SQLException
public boolean parent(Node child)
throws java.sql.SQLException
child -
java.sql.SQLException
public boolean child(Node parent)
throws java.sql.SQLException
parent -
java.sql.SQLException
public boolean query(short type,
java.lang.Object value)
throws java.sql.SQLException
type - value -
java.sql.SQLException
public boolean query(Data data)
throws java.sql.SQLException
data -
java.sql.SQLException
public boolean fill(int depth,
int start,
int limit)
throws java.sql.SQLException
query(short, Object), query(Data) or #query(Node) first.
Only fetches data from the database the first time.
depth - start - limit -
java.sql.SQLException
public boolean link(int start,
int limit)
throws java.sql.SQLException
query(short, Object), query(Data) or #query(Node) first.
Only fetches data from the database the first time.
start - limit -
java.sql.SQLException
public boolean meta()
throws java.sql.SQLException
query(short, Object), query(Data) or #query(Node) first.
Only fetches data from the database the first time.
java.sql.SQLExceptionpublic java.lang.String safe(short type)
fill(int, int, int) or meta() first.
type -
public Data meta(short type)
fill(int, int, int) or meta() first.
type -
public java.util.LinkedList child(int type)
throws java.sql.SQLException
fill(int, int, int) or link(int, int) first.
type -
java.sql.SQLException
public Node child(int link,
short meta,
java.lang.String value)
throws java.sql.SQLException
fill(int, int, int) or link(int, int) first.
link - The node type.meta - The data type.value -
java.sql.SQLException
public Node parent(int type,
Data data,
int limit)
throws java.sql.SQLException
type - data - limit - How many parents to select
java.sql.SQLException
public Node parent(int type)
throws java.sql.SQLException
type -
java.sql.SQLException
public Node child(long id)
throws java.sql.SQLException
fill(int, int, int) or link(int, int) first.
id -
java.sql.SQLExceptionpublic java.lang.String path()
public java.lang.String encoded()
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionpublic java.lang.String date()
public java.lang.String time()
public java.lang.String toString()
toString in class NodeBeanpublic java.lang.String toXML(int padding)
public boolean remove(short type)
throws java.lang.Exception
java.lang.Exception
public boolean poll(short type)
throws java.lang.Exception
java.lang.Exception
public boolean poll(short type,
int increment)
throws java.lang.Exception
java.lang.Exception
public double count(short type)
throws java.lang.Exception
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||