Class URIString
java.lang.Object
org.sblim.cimclient.internal.uri.URIString
- All Implemented Interfaces:
CharSequence
Class URIString is responsible for wrapping the WBEM-URI string. It has
methods which help in parsing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncharcharAt(int pIdx) voidCuts out the first character.booleancutStarting(char pC) Cuts out the first character if it ispC.voidcutStarting(int pChars) Cuts out pChars pieces of characters from the beginning.booleancutStarting(CharSequence pSeq) Cuts outpSeqfrom the beginning if it is there.booleancutStarting(String pStr, boolean pIgnoreCase) Cuts outpStrfrom the beginning if it is there.deepCopy()deepCopyintfind(char pChar) findintgetPos()getPosgroup(int pI) intlength()markPositionmarkPosition(int pPos) markPositionbooleanmatchAndCut(Pattern pPat, int pGroup) Matches patternpPatand cuts out the beginning till the end of matcher grouppGroup.removeTill(char pChar) removeTill(pChar, false, false);removeTill(char pChar, boolean pRemoveChar) removeTill(pChar, pRemoveChar, false);removeTill(char pChar, boolean pRemoveChar, boolean pMustFound) Removes the beginning of the string till the first occurrence of pChar or removes the whole string if it doesn't contain pChar and pMustFound is false.voidsetbooleanstartsWith(char pC) startsWithsubSequence(int pStart, int pEnd) substring(int pBeginIdx, int pEndIdx) Returns a new string that is a substring of this string.toInitStringtoString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface CharSequence
chars, codePoints, getChars, isEmpty
-
Constructor Details
-
URIString
public URIString(char[] pCharArray, int pStart, int pEnd) Ctor.- Parameters:
pCharArray-pStart-pEnd-
-
URIString
public URIString(char[] pCharArray) Ctor.- Parameters:
pCharArray-
-
URIString
-
URIString
-
-
Method Details
-
set
-
deepCopy
-
find
public int find(char pChar) find- Parameters:
pChar-- Returns:
- Position of
pCharor -1 if not found.
-
charAt
public char charAt(int pIdx) - Specified by:
charAtin interfaceCharSequence- See Also:
-
length
public int length()- Specified by:
lengthin interfaceCharSequence- See Also:
-
subSequence
- Specified by:
subSequencein interfaceCharSequence- See Also:
-
toString
- Specified by:
toStringin interfaceCharSequence- Overrides:
toStringin classObject- See Also:
-
toInitString
toInitString- Returns:
- The String which was used for initializing this instance.
-
getPos
public int getPos()getPos- Returns:
- The position of parsing.
-
markPosition
-
markPosition
markPosition- Parameters:
pPos-- Returns:
- a String which marks position pPos.
-
substring
Returns a new string that is a substring of this string. The substring begins at the specified pBeginIdx and extends to the character at index pEndIdx - 1. Thus the length of the substring is pEndIdx-pBeginIdx.- Parameters:
pBeginIdx-pEndIdx-- Returns:
- String
-
startsWith
public boolean startsWith(char pC) startsWith- Parameters:
pC-- Returns:
trueif the first character ispC.
-
cutStarting
public void cutStarting()Cuts out the first character. -
cutStarting
public boolean cutStarting(char pC) Cuts out the first character if it ispC.- Parameters:
pC-- Returns:
trueif cut is done.
-
cutStarting
Cuts outpSeqfrom the beginning if it is there.- Parameters:
pSeq-- Returns:
trueif cut is done.
-
cutStarting
Cuts outpStrfrom the beginning if it is there.- Parameters:
pStr-pIgnoreCase-- Returns:
trueif cut is done.
-
cutStarting
public void cutStarting(int pChars) Cuts out pChars pieces of characters from the beginning.- Parameters:
pChars-
-
removeTill
Removes the beginning of the string till the first occurrence of pChar or removes the whole string if it doesn't contain pChar and pMustFound is false.- Parameters:
pChar-pRemoveChar- iftrue pCharwill be removed toopMustFound-- Returns:
- the removed substring or
nullifpCharnot found andpMustFoundistrue
-
removeTill
removeTill(pChar, pRemoveChar, false);- Parameters:
pChar-pRemoveChar-- Returns:
- String
- See Also:
-
removeTill
removeTill(pChar, false, false);- Parameters:
pChar-- Returns:
- String
- See Also:
-
matchAndCut
Matches patternpPatand cuts out the beginning till the end of matcher grouppGroup.- Parameters:
pPat-pGroup-- Returns:
trueif pattern is matched and cut was done.
-
group
- Parameters:
pI-- Returns:
- pI'th matcher group
-