public class DBtokenizer extends Object
| 构造器和说明 |
|---|
DBtokenizer(String string,
char delim)
Create a tokeniser.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
DBtokenizer |
tokenizeToken(int n,
char delim)
This returns a new tokenizer based on one of our tokens.
|
public DBtokenizer(String string, char delim)
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 tokenspublic int tokenize(String string, char delim)
string - containing tokensdelim - single character to split the tokenspublic int getSize()
public String getToken(int n)
n - Token number ( 0 ... getSize()-1 )public DBtokenizer tokenizeToken(int n, char delim)
This returns a new tokenizer based on one of our tokens.
The geometric datatypes use this to process nested tokens (usually DBpoint).
n - Token number ( 0 ... getSize()-1 )delim - The delimiter to usepublic static String remove(String s, String l, String t)
s - Source stringl - Leading string to removet - Trailing string to removepublic void remove(String l, String t)
l - Leading string to removet - Trailing string to removepublic static String removePara(String s)
s - String to remove frompublic void removePara()
public static String removeBox(String s)
s - String to remove frompublic void removeBox()
public static String removeAngle(String s)
s - String to remove frompublic void removeAngle()
public static String removeCurlyBrace(String s)
s - String to remove frompublic void removeCurlyBrace()
Copyright © 2025. All rights reserved.