Package org.sblim.cimclient.internal.uri
Class URIString
- java.lang.Object
-
- org.sblim.cimclient.internal.uri.URIString
-
- All Implemented Interfaces:
java.lang.CharSequence
public class URIString extends java.lang.Object implements java.lang.CharSequenceClass URIString is responsible for wrapping the WBEM-URI string. It has methods which help in parsing.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description charcharAt(int pIdx)voidcutStarting()Cuts 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(java.lang.CharSequence pSeq)Cuts outpSeqfrom the beginning if it is there.booleancutStarting(java.lang.String pStr, boolean pIgnoreCase)Cuts outpStrfrom the beginning if it is there.URIStringdeepCopy()deepCopyintfind(char pChar)findintgetPos()getPosjava.lang.Stringgroup(int pI)intlength()java.lang.StringmarkPosition()markPositionjava.lang.StringmarkPosition(int pPos)markPositionbooleanmatchAndCut(java.util.regex.Pattern pPat, int pGroup)Matches patternpPatand cuts out the beginning till the end of matcher grouppGroup.java.lang.StringremoveTill(char pChar)removeTill(pChar, false, false);java.lang.StringremoveTill(char pChar, boolean pRemoveChar)removeTill(pChar, pRemoveChar, false);java.lang.StringremoveTill(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.voidset(URIString pUriStr)setbooleanstartsWith(char pC)startsWithjava.lang.CharSequencesubSequence(int pStart, int pEnd)java.lang.Stringsubstring(int pBeginIdx, int pEndIdx)Returns a new string that is a substring of this string.java.lang.StringtoInitString()toInitStringjava.lang.StringtoString()
-
-
-
Constructor Detail
-
URIString
public URIString(char[] pCharArray, int pStart, int pEnd)Ctor.- Parameters:
pCharArray-pStart-pEnd-
-
URIString
public URIString(char[] pCharArray)
Ctor.- Parameters:
pCharArray-
-
URIString
public URIString(java.lang.String pStr)
Ctor.- Parameters:
pStr-
-
URIString
public URIString(URIString pUriStr)
Ctor.- Parameters:
pUriStr-
-
-
Method Detail
-
set
public void set(URIString pUriStr)
set- Parameters:
pUriStr-
-
deepCopy
public URIString deepCopy()
deepCopy- Returns:
URIStringinstance
-
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 interfacejava.lang.CharSequence- See Also:
CharSequence.charAt(int)
-
length
public int length()
- Specified by:
lengthin interfacejava.lang.CharSequence- See Also:
CharSequence.length()
-
subSequence
public java.lang.CharSequence subSequence(int pStart, int pEnd)- Specified by:
subSequencein interfacejava.lang.CharSequence- See Also:
CharSequence.subSequence(int, int)
-
toString
public java.lang.String toString()
- Specified by:
toStringin interfacejava.lang.CharSequence- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
toInitString
public java.lang.String toInitString()
toInitString- Returns:
- The String which was used for initializing this instance.
-
getPos
public int getPos()
getPos- Returns:
- The position of parsing.
-
markPosition
public java.lang.String markPosition()
markPosition- Returns:
- a String which marks the position of parsing.
-
markPosition
public java.lang.String markPosition(int pPos)
markPosition- Parameters:
pPos-- Returns:
- a String which marks position pPos.
-
substring
public java.lang.String substring(int pBeginIdx, int pEndIdx)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
public boolean cutStarting(java.lang.CharSequence pSeq)
Cuts outpSeqfrom the beginning if it is there.- Parameters:
pSeq-- Returns:
trueif cut is done.
-
cutStarting
public boolean cutStarting(java.lang.String pStr, boolean pIgnoreCase)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
public java.lang.String 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.- Parameters:
pChar-pRemoveChar- iftrue pCharwill be removed toopMustFound-- Returns:
- the removed substring or
nullifpCharnot found andpMustFoundistrue
-
removeTill
public java.lang.String removeTill(char pChar, boolean pRemoveChar)removeTill(pChar, pRemoveChar, false);- Parameters:
pChar-pRemoveChar-- Returns:
- String
- See Also:
removeTill(char, boolean, boolean)
-
removeTill
public java.lang.String removeTill(char pChar)
removeTill(pChar, false, false);- Parameters:
pChar-- Returns:
- String
- See Also:
removeTill(char, boolean, boolean)
-
matchAndCut
public boolean matchAndCut(java.util.regex.Pattern pPat, int pGroup)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
public java.lang.String group(int pI)
- Parameters:
pI-- Returns:
- pI'th matcher group
-
-