|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.postgresql.util.PGtokenizer
public class PGtokenizer
This class is used to tokenize the text output of org.postgres. It's mainly used by the geometric classes, but is useful in parsing any output from custom data types output from org.postgresql.
PGbox,
PGcircle,
PGlseg,
PGpath,
PGpoint,
PGpolygon| Field Summary | |
|---|---|
protected List<String> |
tokens
|
| Constructor Summary | |
|---|---|
PGtokenizer(String string,
char delim)
Create a tokeniser. |
|
| Method Summary | |
|---|---|
int |
getSize()
|
String |
getToken(int n)
|
void |
remove(String l,
String t)
This removes the lead/trailing strings from all tokens |
static String |
remove(String s,
String l,
String t)
This removes the lead/trailing strings from a string |
void |
removeAngle()
Removes < and > from the beginning and end of all tokens |
static String |
removeAngle(String s)
Removes < and > from the beginning and end of a string |
void |
removeBox()
Removes [ and ] from the beginning and end of all tokens |
static String |
removeBox(String s)
Removes [ and ] from the beginning and end of a string |
void |
removeCurlyBrace()
Removes < and > from the beginning and end of all tokens |
static String |
removeCurlyBrace(String s)
Removes curly braces { and } from the beginning and end of a string |
void |
removePara()
Removes ( and ) from the beginning and end of all tokens |
static String |
removePara(String s)
Removes ( and ) from the beginning and end of a string |
int |
tokenize(String string,
char delim)
This resets this tokenizer with a new string and/or delimiter. |
PGtokenizer |
tokenizeToken(int n,
char delim)
This returns a new tokenizer based on one of our tokens. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected List<String> tokens
| Constructor Detail |
|---|
public PGtokenizer(String string,
char delim)
We could have used StringTokenizer to do this, however, we needed to handle nesting of '(' ')' '[' ']' '<' and '>' as these are used by the geometric data types.
string - containing tokensdelim - single character to split the tokens| Method Detail |
|---|
public int tokenize(String string,
char delim)
string - containing tokensdelim - single character to split the tokens
public int getSize()
public String getToken(int n)
n - Token number ( 0 ... getSize()-1 )
public PGtokenizer tokenizeToken(int n,
char delim)
n - Token number ( 0 ... getSize()-1 )delim - The delimiter to use
public static String remove(String s,
String l,
String t)
s - Source stringl - Leading string to removet - Trailing string to remove
public void remove(String l,
String t)
l - Leading string to removet - Trailing string to removepublic static String removePara(String s)
s - String to remove from
public void removePara()
public static String removeBox(String s)
s - String to remove from
public void removeBox()
public static String removeAngle(String s)
s - String to remove from
public void removeAngle()
public static String removeCurlyBrace(String s)
s - String to remove from
public void removeCurlyBrace()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||