Package org.sblim.cimclient.internal.cim
Class DTStringReader
java.lang.Object
org.sblim.cimclient.internal.cim.DTStringReader
public class DTStringReader
extends java.lang.Object
Class DTString helps parsing CIMDateTime Strings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getPos()
getPosboolean
isUnsignificantchar
read()
readvoid
read
(char c) read - Throws an IllegalArgumentException if the read character is not c.int
read
(int pLen, java.lang.String pFieldName, boolean pAllowUnsignificant) readint
readAndCheck
(int pLen, java.lang.String pFieldName, int pMin, int pMax, boolean pAllowUnsignificant) readAndCheckMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
DTStringReader
public DTStringReader(java.lang.String pDateTimeStr) Ctor.- Parameters:
pDateTimeStr
-
-
-
Method Details
-
read
public int read(int pLen, java.lang.String pFieldName, boolean pAllowUnsignificant) throws java.lang.IllegalArgumentException read- Parameters:
pLen
- - number of characters to be read from the stringpFieldName
- - the name of the field which is to be read (e.g. year, month, day ...)pAllowUnsignificant
-- Returns:
- int
- Throws:
java.lang.IllegalArgumentException
-
readAndCheck
public int readAndCheck(int pLen, java.lang.String pFieldName, int pMin, int pMax, boolean pAllowUnsignificant) throws java.lang.IllegalArgumentException readAndCheck- Parameters:
pLen
- - number of digits to readpFieldName
- - the name of the field which is to be read (e.g. year, month, day...)pMin
- - the allowed minimum value (-1 is always allowed as not significant)pMax
- - the allowed maximum valuepAllowUnsignificant
-- Returns:
- int
- Throws:
java.lang.IllegalArgumentException
-
read
public char read()read- Returns:
- a char, 0 if failed
-
read
public void read(char c) throws java.lang.IllegalArgumentException read - Throws an IllegalArgumentException if the read character is not c.- Parameters:
c
- - contains the character which should be read from the String.- Throws:
java.lang.IllegalArgumentException
-
getPos
public int getPos()getPos- Returns:
- the position in the reader
-
isUnsignificant
public boolean isUnsignificant()isUnsignificant- Returns:
- boolean
-