org.sblim.cimclient.internal.cim

Class DTStringReader

public class DTStringReader extends Object

Class DTString helps parsing CIMDateTime Strings.
Constructor Summary
DTStringReader(String pDateTimeStr)
Ctor.
Method Summary
intgetPos()
getPos
booleanisUnsignificant()
isUnsignificant
intread(int pLen, String pFieldName, boolean pAllowUnsignificant)
read
charread()
read
voidread(char c)
read - Throws an IllegalArgumentException if the read character is not c.
intreadAndCheck(int pLen, String pFieldName, int pMin, int pMax, boolean pAllowUnsignificant)
readAndCheck

Constructor Detail

DTStringReader

public DTStringReader(String pDateTimeStr)
Ctor.

Parameters: pDateTimeStr

Method Detail

getPos

public int getPos()
getPos

Returns: the position in the reader

isUnsignificant

public boolean isUnsignificant()
isUnsignificant

Returns: boolean

read

public int read(int pLen, String pFieldName, boolean pAllowUnsignificant)
read

Parameters: pLen - number of characters to be readed from the string pFieldName - the name of the field which is to be read (e.g. year, mounth, day ...) pAllowUnsignificant

Returns: int

Throws: IllegalArgumentException

read

public char read()
read

Returns: a char, 0 if failed

read

public void read(char c)
read - Throws an IllegalArgumentException if the read character is not c.

Parameters: c - contains the character which should be read from the String.

Throws: IllegalArgumentException

readAndCheck

public int readAndCheck(int pLen, String pFieldName, int pMin, int pMax, boolean pAllowUnsignificant)
readAndCheck

Parameters: pLen - number of digits to read pFieldName - the name of the field which is to be read (e.g. year, mounth, day...) pMin - the allowed minimum value (-1 is always allowed as not significant) pMax - the allowed maximum value pAllowUnsignificant

Returns: int

Throws: IllegalArgumentException

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