|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xbn.XBNObject | +--xbn.string.TrimChars
Trim characters off the ends of a string.
Source code: TrimChars.java
Fields inherited from class xbn.XBNObject |
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP |
Constructor Summary | |
TrimChars()
Create a TrimChars with default settings. |
|
TrimChars(char[] ac_charsToTrim)
Create a TrimChars. |
|
TrimChars(char[] ac_toTrim,
boolean b_validateACToTrim)
Create a TrimChars. |
|
TrimChars(char[] ac_charsToTrim,
boolean b_checkRightForEsc,
char c_escape)
Create a TrimChars. |
|
TrimChars(char[] ac_toTrim,
boolean b_checkRightForEsc,
char c_escape,
boolean b_validateParams)
Create a TrimChars. |
|
TrimChars(char[] ac_charsToTrim,
char c_escape)
Create a TrimChars. |
|
TrimChars(char[] ac_toTrim,
TALConfig tal_config)
Create a TrimChars. |
|
TrimChars(char[] ac_toTrim,
TALConfig tal_config,
boolean b_validateParams)
Create a TrimChars. |
|
TrimChars(char[] ac_toTrim,
TALConfig tal_config,
boolean b_checkRightForEsc,
char c_escape)
Create a TrimChars. |
|
TrimChars(char[] ac_toTrim,
TALConfig tal_config,
boolean b_checkRightForEsc,
char c_escape,
boolean b_validateParams)
Create a TrimChars. |
|
TrimChars(TALConfig tal_config)
Create a TrimChars. |
Method Summary | |
boolean |
doCheckRightForEsc()
Should only non-escaped characters be trimmed from the right side? |
String |
get(String s_tr)
Get a copy of the string where characters have been trimmed. |
StringBuffer |
get(StringBuffer str_buffer)
Get a copy of the StringBuffer where characters have been trimmed. |
StringBuffer |
get(StringBuffer str_buffer,
int i_idxLeft,
int i_idxAfterRight)
Get a copy of the StringBuffer where characters have been trimmed. |
String |
get(String s_tr,
int i_idxLeft,
int i_idxAfterRight)
Get a copy of the string where characters have been trimmed. |
SOBStringBuffer |
get(StringOrBuffer str_orBfr)
Get a copy of the StringOrBuffer (as an SOBStringBuffer) where characters have been trimmed. |
SOBStringBuffer |
get(StringOrBuffer str_orBfr,
int i_idxLeft,
int i_idxAfterRight)
Get a copy of the StringOrBuffer (as an SOBStringBuffer) where characters have been trimmed. |
String |
getAllLines(String s_tr)
Get a copy of the string where characters have been trimmed from the ends of every line. |
StringBuffer |
getAllLines(StringBuffer str_buffer)
Get a copy of the StringBuffer where characters have been trimmed from the ends of every line. |
SOBStringBuffer |
getAllLines(StringOrBuffer str_orBfr)
Get a copy of the StringOrBuffer where characters have been trimmed from the ends of every line. |
APChar |
getAPCToTrim()
Get the array of characters to be trimmed. |
char |
getEscapeChar()
The escape character, when only non-escaped chararcters are trimmed from the right side. |
TALConfig |
getTALConfig()
Get the TALConfig, which holds the configuration for trimAllLines. |
i_i |
getTrimData()
Get information about the just-called trim or get. |
i_i |
trim(StringBuffer str_buffer)
Trim characters off the ends of the StringBuffer. |
i_i |
trim(StringBuffer str_buffer,
int i_idxLeft,
int i_idxAfterRight)
Trim characters off the ends of the StringBuffer. |
i_i |
trim(StringOrBuffer str_orBfr)
Trim characters off the ends of the StringOrBuffer. |
i_i |
trim(StringOrBuffer str_orBfr,
int i_idxLeft,
int i_idxAfterRight)
Trim characters off the ends of the StringOrBuffer. |
void |
trimAllLines(StringBuffer str_buffer)
Trim characters off the ends of every line in the StringBuffer. |
void |
trimAllLines(StringOrBuffer str_orBfr)
TrimChars the characters from the start and end of each line within the StringOrBuffer. |
Methods inherited from class xbn.XBNObject |
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TrimChars()
Create a TrimChars with default settings.
Equal to TrimChars(UtilChar.getAOCTabSpace())
public TrimChars(char[] ac_charsToTrim)
Create a TrimChars.
Equal to TrimChars(ac_charsToTrim, bFALSE_IN_PRODUCTION)
public TrimChars(char[] ac_charsToTrim, boolean b_checkRightForEsc, char c_escape)
Create a TrimChars.
Equal to TrimChars(ac_charsToTrim, b_checkRightForEsc, c_escape, bFALSE_IN_PRODUCTION)
public TrimChars(char[] ac_charsToTrim, char c_escape)
Create a TrimChars.
Equal to TrimChars(ac_charsToTrim, true, c_escape)
public TrimChars(TALConfig tal_config)
Create a TrimChars.
Equal to TrimChars((UtilChar.getAOCTabSpace(), tal_config)
public TrimChars(char[] ac_toTrim, TALConfig tal_config)
Create a TrimChars.
Equal to TrimChars((ac_toTrim, tal_config, bFALSE_IN_PRODUCTION)
public TrimChars(char[] ac_toTrim, boolean b_validateACToTrim)
public TrimChars(char[] ac_toTrim, TALConfig tal_config, boolean b_validateParams)
Create a TrimChars.
Equal to TrimChars(ac_toTrim, tal_config, false, ' ', b_validateACToTrim)
public TrimChars(char[] ac_toTrim, TALConfig tal_config, boolean b_checkRightForEsc, char c_escape)
Create a TrimChars.
Equal to TrimChars(ac_toTrim, tal_config, b_checkRightForEsc, c_escape, bFALSE_IN_PRODUCTION)
public TrimChars(char[] ac_toTrim, boolean b_checkRightForEsc, char c_escape, boolean b_validateParams)
Create a TrimChars.
Equal to TrimChars(ac_toTrim, (new TALConfig()), b_checkRightForEsc, c_escape, b_validateParams)
public TrimChars(char[] ac_toTrim, TALConfig tal_config, boolean b_checkRightForEsc, char c_escape, boolean b_validateParams)
Create a TrimChars.
ac_toTrim
- The array of characters to trim. May not be null or zero elements in length. Must have all unique values, ordered ascending ('a', 'b', 'c', ...). See getAPCToTrim.tal_config
- The configuration for trimAllLines. May not be null, and tal_config.getLineSeparator may not contain any characters existing in ac_toTrim (or c_escape, if b_checkRightForEsc is true). See getTALConfigb_checkRightForEsc
- If true, then before the right side is trimmed, it is ensured that the character that is about to be eliminated, is not escaped. If it is, trimming stops. When b_trimRight equals false, this must equal false. See doCheckRightForEsc.c_escape
- The escape character, when b_checkRightForEsc is true (this may not equal any member of ac_toTrim). When b_checkRightForEsc equals false, this must equal ' '. See getEscapeChar.b_validateParams
- If true, then all documented parameter restrictions are checked, and an AssertException is thrown when any violation is found. When false, be darn-tooting sure the parameters coform to documented restrictions.Method Detail |
public final APChar getAPCToTrim()
Get the array of characters to be trimmed.
new APChar(ac_toTrim)
Where ac_toTrim is exactly as provided to the constructor.public final TALConfig getTALConfig()
Get the TALConfig, which holds the configuration for trimAllLines. See trimAllLines.
public final boolean doCheckRightForEsc()
Should only non-escaped characters be trimmed from the right side?
When this equals true, getEscapeChar is used. When this returns false, getEscapeChar is ignored.
public final char getEscapeChar()
The escape character, when only non-escaped chararcters are trimmed from the right side.
When this character preceds a to-be-trimmed character existing on the right hand side of a string, then it is not trimmed.
See doCheckRightForEsc. If doCheckRightForEsc equals false, this is ignored.
public final String get(String s_tr)
Get a copy of the string where characters have been trimmed.
get([UtilString].getSOBSB(s_tr, "xbn.string.TrimChars.get")).toString()
public final String get(String s_tr, int i_idxLeft, int i_idxAfterRight)
Get a copy of the string where characters have been trimmed.
get([UtilString].getSOBSB(s_tr, "xbn.string.TrimChars.get"), i_idxLeft, i_idxAfterRight).toString()
public final StringBuffer get(StringBuffer str_buffer)
Get a copy of the StringBuffer where characters have been trimmed.
get([UtilStringBuffer].getSOBSB(str_buffer, "xbn.string.TrimChars.get")).getStringBuffer()
public final StringBuffer get(StringBuffer str_buffer, int i_idxLeft, int i_idxAfterRight)
Get a copy of the StringBuffer where characters have been trimmed.
get([UtilStringBuffer].getSOBSB(str_buffer, "xbn.string.TrimChars.get"), i_idxLeft, i_idxAfterRight).getStringBuffer()
public final SOBStringBuffer get(StringOrBuffer str_orBfr)
Get a copy of the StringOrBuffer (as an SOBStringBuffer) where characters have been trimmed.
trim([UtilSOB].getSOBSB(str_orBfr, "xbn.string.TrimChars.get"))
public final SOBStringBuffer get(StringOrBuffer str_orBfr, int i_idxLeft, int i_idxAfterRight)
Get a copy of the StringOrBuffer (as an SOBStringBuffer) where characters have been trimmed.
trim([UtilSOB].getSOBSB(str_orBfr, "xbn.string.TrimChars.get"), i_idxLeft, i_idxAfterRight)
public final i_i trim(StringBuffer str_buffer)
Trim characters off the ends of the StringBuffer.
trim([UtilStringBuffer].getSOBSB(str_buffer, "xbn.string.TrimChars.trim"))
public final i_i trim(StringBuffer str_buffer, int i_idxLeft, int i_idxAfterRight)
Trim characters off the ends of the StringBuffer.
trim([UtilStringBuffer].getSOBSB(str_buffer, "xbn.string.TrimChars.trim"), i_idxLeft, i_idxAfterRight)
public final i_i trim(StringOrBuffer str_orBfr)
Trim characters off the ends of the StringOrBuffer.
trim(str_orBfr, 0, str_orBfr.length())
public final i_i trim(StringOrBuffer str_orBfr, int i_idxLeft, int i_idxAfterRight)
Trim characters off the ends of the StringOrBuffer.
str_orBfr
- The StringOrBuffer to trim. May not be null.i_idxLeft
- The left-most index in str_orBfr to start trimming from. If -1, then do not trim characters from the left side. Otherwise, must be a valid string index for str_orBfr, may not be greater than i_idxAfterRight (assuming i_idxAfterRight is not equal to -1).i_idxAfterRight
- The string index after the right-most index in str_orBfr to start trimming from. If -1, then do not trim characters from the right side. Otherwise, must be a valid string index for str_orBfr, and may not be less than i_idxLeft (assuming i_idxLeft is not equal to -1).public final i_i getTrimData()
Get information about the just-called trim or get. See trim and get.
public final String getAllLines(String s_tr)
Get a copy of the string where characters have been trimmed from the ends of every line.
getAllLines([UtilString].getSOBSB(s_tr, "xbn.string.TrimChars.getAllLines")).toString()
public final StringBuffer getAllLines(StringBuffer str_buffer)
Get a copy of the StringBuffer where characters have been trimmed from the ends of every line.
getAllLines([UtilStringBuffer].getSOBSB(str_buffer, "xbn.string.TrimChars.getAllLines")).toString()
public final SOBStringBuffer getAllLines(StringOrBuffer str_orBfr)
Get a copy of the StringOrBuffer where characters have been trimmed from the ends of every line.
trimAllLines([UtilSOB].getSOBSB(str_orBfr, "xbn.string.TrimChars.getAllLines"))
public final void trimAllLines(StringBuffer str_buffer)
Trim characters off the ends of every line in the StringBuffer.
Equal to trimAllLines([UtilStringBuffer].getSOBSB(str_buffer, "xbn.string.TrimChars.trimAllLines"))
public final void trimAllLines(StringOrBuffer str_orBfr)
TrimChars the characters from the start and end of each line within the StringOrBuffer. The configuration for this function is held by getTALConfig.
str_orBfr
- The StringOrBuffer to trim. May not be null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.
http://sourceforge.net/projects/xbnjava