パッケージ org.postgresql.util
クラス PGtokenizer
java.lang.Object
org.postgresql.util.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.
-
フィールドの概要
フィールド -
コンストラクタの概要
コンストラクタ -
メソッドの概要
修飾子とタイプメソッド説明int
getSize()
getToken
(int n) void
This removes the lead/trailing strings from all tokens.static String
This removes the lead/trailing strings from a string.void
Removes < and > from the beginning and end of all tokens.static String
Removes < and > from the beginning and end of a string.void
Removes [ and ] from the beginning and end of all tokens.static String
Removes [ and ] from the beginning and end of a string.void
Removes < and > from the beginning and end of all tokens.static String
Removes curly braces { and } from the beginning and end of a string.void
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
This resets this tokenizer with a new string and/or delimiter.tokenizeToken
(int n, char delim) This returns a new tokenizer based on one of our tokens.
-
フィールド詳細
-
tokens
-
-
コンストラクタの詳細
-
PGtokenizer
Create a tokeniser.
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
-
-
メソッドの詳細
-
tokenize
This resets this tokenizer with a new string and/or delimiter.- パラメータ:
string
- containing tokensdelim
- single character to split the tokens- 戻り値:
- number of tokens
-
getSize
public int getSize()- 戻り値:
- the number of tokens available
-
getToken
- パラメータ:
n
- Token number ( 0 ... getSize()-1 )- 戻り値:
- The token value
-
tokenizeToken
This returns a new tokenizer based on one of our tokens.
The geometric datatypes use this to process nested tokens (usually PGpoint).
- パラメータ:
n
- Token number ( 0 ... getSize()-1 )delim
- The delimiter to use- 戻り値:
- A new instance of PGtokenizer based on the token
-
remove
This removes the lead/trailing strings from a string.- パラメータ:
s
- Source stringl
- Leading string to removet
- Trailing string to remove- 戻り値:
- String without the lead/trailing strings
-
remove
This removes the lead/trailing strings from all tokens.- パラメータ:
l
- Leading string to removet
- Trailing string to remove
-
removePara
Removes ( and ) from the beginning and end of a string.- パラメータ:
s
- String to remove from- 戻り値:
- String without the ( or )
-
removePara
public void removePara()Removes ( and ) from the beginning and end of all tokens. -
removeBox
Removes [ and ] from the beginning and end of a string.- パラメータ:
s
- String to remove from- 戻り値:
- String without the [ or ]
-
removeBox
public void removeBox()Removes [ and ] from the beginning and end of all tokens. -
removeAngle
Removes < and > from the beginning and end of a string.- パラメータ:
s
- String to remove from- 戻り値:
- String without the < or >
-
removeAngle
public void removeAngle()Removes < and > from the beginning and end of all tokens. -
removeCurlyBrace
Removes curly braces { and } from the beginning and end of a string.- パラメータ:
s
- String to remove from- 戻り値:
- String without the { or }
-
removeCurlyBrace
public void removeCurlyBrace()Removes < and > from the beginning and end of all tokens.
-