org.sblim.cimclient.internal.uri

Class URIString

public class URIString extends Object implements CharSequence

Class URIString is responsible for wrapping the WBEM-URI string. It has methods which help in parsing.
Constructor Summary
URIString(char[] pCharArray, int pStart, int pEnd)
Ctor.
URIString(char[] pCharArray)
Ctor.
URIString(String pStr)
Ctor.
URIString(URIString pUriStr)
Ctor.
Method Summary
charcharAt(int pIdx)
voidcutStarting()
Cuts out the first character.
booleancutStarting(char pC)
Cuts out the first character if it is pC.
booleancutStarting(CharSequence pSeq)
Cuts out pSeq from the beginning if it is there.
booleancutStarting(String pStr, boolean pIgnoreCase)
Cuts out pStr from the beginning if it is there.
voidcutStarting(int pChars)
Cuts out pChars pieces of characters from the beginning.
URIStringdeepCopy()
deepCopy
intfind(char pChar)
find
intgetPos()
getPos
Stringgroup(int pI)
intlength()
StringmarkPosition()
markPosition
StringmarkPosition(int pPos)
markPosition
booleanmatchAndCut(Pattern pPat, int pGroup)
Matches pattern pPat and cuts out the beginning till the end of matcher group pGroup.
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.
StringremoveTill(char pChar, boolean pRemoveChar)
removeTill(pChar, pRemoveChar, false);
StringremoveTill(char pChar)
removeTill(pChar, false, false);
voidset(URIString pUriStr)
set
booleanstartsWith(char pC)
startsWith
Stringsubstring(int pBeginIdx, int pEndIdx)
Returns a new string that is a substring of this string.
CharSequencesubSequence(int pStart, int pEnd)
StringtoInitString()
toInitString

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(String pStr)
Ctor.

Parameters: pStr

URIString

public URIString(URIString pUriStr)
Ctor.

Parameters: pUriStr

Method Detail

charAt

public char charAt(int pIdx)

See Also: java.lang.CharSequence#charAt(int)

cutStarting

public void cutStarting()
Cuts out the first character.

cutStarting

public boolean cutStarting(char pC)
Cuts out the first character if it is pC.

Parameters: pC

Returns: true if cut is done.

cutStarting

public boolean cutStarting(CharSequence pSeq)
Cuts out pSeq from the beginning if it is there.

Parameters: pSeq

Returns: true if cut is done.

cutStarting

public boolean cutStarting(String pStr, boolean pIgnoreCase)
Cuts out pStr from the beginning if it is there.

Parameters: pStr pIgnoreCase

Returns: true if cut is done.

cutStarting

public void cutStarting(int pChars)
Cuts out pChars pieces of characters from the beginning.

Parameters: pChars

deepCopy

public URIString deepCopy()
deepCopy

Returns: URIString instance

find

public int find(char pChar)
find

Parameters: pChar

Returns: Position of pChar or -1 if not found.

getPos

public int getPos()
getPos

Returns: The position of parsing.

group

public String group(int pI)

Parameters: pI

Returns: pI'th matcher group

length

public int length()

See Also: java.lang.CharSequence#length()

markPosition

public String markPosition()
markPosition

Returns: a String which marks the position of parsing.

markPosition

public String markPosition(int pPos)
markPosition

Parameters: pPos

Returns: a String which marks position pPos.

matchAndCut

public boolean matchAndCut(Pattern pPat, int pGroup)
Matches pattern pPat and cuts out the beginning till the end of matcher group pGroup.

Parameters: pPat pGroup

Returns: true if pattern is matched and cut was done.

removeTill

public 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 if true pChar will be removed too pMustFound

Returns: the removed substring or null if pChar not found and pMustFound is true

removeTill

public String removeTill(char pChar, boolean pRemoveChar)
removeTill(pChar, pRemoveChar, false);

Parameters: pChar pRemoveChar

Returns: String

See Also: URIString

removeTill

public String removeTill(char pChar)
removeTill(pChar, false, false);

Parameters: pChar

Returns: String

See Also: URIString

set

public void set(URIString pUriStr)
set

Parameters: pUriStr

startsWith

public boolean startsWith(char pC)
startsWith

Parameters: pC

Returns: true if the first character is pC.

substring

public 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

subSequence

public CharSequence subSequence(int pStart, int pEnd)

See Also: java.lang.CharSequence#subSequence(int, int)

toInitString

public String toInitString()
toInitString

Returns: The String which was used for initializing this instance.

Copyright © 2005, 2009 IBM Corporation. All Rights Reserved.