|
Structured Text Toolkit | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.saelist.stx.Pair
The central data structure of the toolkit. A Pair contains text (key) and optionally a list of pairs (values). The term 'value' is used to refer to the text of the first sub-pair.
| Field Summary | |
protected int |
indent
|
static Logger |
logger
|
protected PairList |
pairList
|
protected Pair |
parent
|
protected int |
srcColumn
|
protected int |
srcLine
|
protected java.lang.String |
text
|
| Constructor Summary | |
protected |
Pair()
|
|
Pair(Pair parent,
int indent,
java.lang.String line,
int srcLine,
int srcColumn)
|
|
Pair(Pair parent,
java.lang.String text)
|
| Method Summary | |
void |
add(int pos,
Pair pair)
Insert the pair at position pos in the list of sub-pairs. |
void |
add(Pair pair)
Appends the pair to the list of sub-pairs. |
void |
clear()
Removes all sub-pairs. |
Pair |
copy()
|
boolean |
equals(java.lang.Object object)
Two pairs are equal if their texts are equals and their sub-pairs match. |
java.lang.String |
eval(java.lang.String xpath)
Returns the concatenated texts of all sub-pairs of the matching xpaths or "" if none match. |
java.lang.String |
eval1(java.lang.String xpath)
Returns the 'value' of the first pair maching the xpath or "" if none. |
Pair |
get(int index)
|
Pair |
get(java.lang.String text)
|
int |
getIndent()
|
java.util.Iterator |
getPairs()
|
Pair |
getParent()
|
Pair |
getRoot()
|
int |
getSrcColumn()
|
int |
getSrcLine()
|
java.lang.String |
getText()
|
java.lang.String |
getValue()
Returns the text of the first sub-pair or "" if none exists. |
java.lang.String |
getValues()
Returns the concatenated texts of all sub-pairs or "" if non exist. |
int |
hashCode()
|
void |
remove(Pair pair)
Removes the pair from the list of sub-pairs. |
java.util.Iterator |
select(java.lang.String xpath)
Returns the pairs matching the xpath. |
Pair |
select1(java.lang.String xpath)
Returns the 1st pair matching the xpath or null if none matches. |
void |
setParent(Pair parent)
|
void |
setText(java.lang.String text)
|
int |
size()
|
java.lang.String |
toString()
A String of the form text[ sub-pair1 sub-pair2 ... |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static Logger logger
protected Pair parent
protected java.lang.String text
protected PairList pairList
protected int indent
protected int srcLine
protected int srcColumn
| Constructor Detail |
public Pair(Pair parent,
java.lang.String text)
public Pair(Pair parent,
int indent,
java.lang.String line,
int srcLine,
int srcColumn)
protected Pair()
| Method Detail |
public int getSrcColumn()
public int getSrcLine()
public int getIndent()
public Pair getRoot()
public Pair getParent()
public void setParent(Pair parent)
public void setText(java.lang.String text)
public java.lang.String getText()
public Pair get(java.lang.String text)
public Pair get(int index)
java.lang.ArrayIndexOutOfBoundsException - if index exceeds size.public java.util.Iterator getPairs()
public java.lang.String getValue()
public java.lang.String getValues()
public java.util.Iterator select(java.lang.String xpath)
public Pair select1(java.lang.String xpath)
public java.lang.String eval1(java.lang.String xpath)
public java.lang.String eval(java.lang.String xpath)
public void add(int pos,
Pair pair)
java.lang.IndexOutOfBoundsException - if no such position exists. I.e. if
pos > size().public void add(Pair pair)
public void clear()
public void remove(Pair pair)
public Pair copy()
public int size()
public java.lang.String toString()
text[ sub-pair1 sub-pair2 ... ] where
each sub-pair may also be composite.
public int hashCode()
public boolean equals(java.lang.Object object)
|
Structured Text Toolkit | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||