Package io.nats.jparse.source
Class CharArrayCharSource
- java.lang.Object
-
- io.nats.jparse.source.CharArrayCharSource
-
- All Implemented Interfaces:
ParseConstants
,CharSource
public class CharArrayCharSource extends java.lang.Object implements CharSource, ParseConstants
-
-
Field Summary
-
Fields inherited from interface io.nats.jparse.node.support.ParseConstants
A, A_, ARRAY_END_TOKEN, ARRAY_SEP, ARRAY_START_TOKEN, ATTRIBUTE_SEP, B, B_, C, C_, CARRIAGE_RETURN_WS, CONTROL_ESCAPE_TOKEN, D, D_, DECIMAL_POINT, DEL, DOT, E, E_, ETX, EXPONENT_MARKER, EXPONENT_MARKER2, F, F_, FALSE_BOOLEAN_START, G, G_, H, H_, I, I_, INDEX_BRACKET_END_TOKEN, INDEX_BRACKET_START_TOKEN, J, J_, K, K_, L, L_, M, M_, MAX_INT_STR, MAX_INT_STR_LENGTH, MAX_LONG_STR, MAX_LONG_STR_LENGTH, MIN_INT_STR, MIN_INT_STR_LENGTH, MIN_LONG_STR, MIN_LONG_STR_LENGTH, MINUS, N, N_, NEST_LEVEL, NEW_LINE_WS, NULL_START, NUM_0, NUM_1, NUM_2, NUM_3, NUM_4, NUM_5, NUM_6, NUM_7, NUM_8, NUM_9, O, O_, OBJECT_ATTRIBUTE_SEP, OBJECT_END_TOKEN, OBJECT_START_TOKEN, P, P_, PLUS, Q, Q_, R, R_, S, S_, SINGLE_QUOTE, SPACE_WS, STRING_END_TOKEN, STRING_START_TOKEN, T, T_, TAB_WS, TRUE_BOOLEAN_START, U, U_, V, V_, W, W_, X, X_, Y, Y_, Z, Z_
-
-
Constructor Summary
Constructors Constructor Description CharArrayCharSource(char[] chars)
CharArrayCharSource(java.lang.String str)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkForJunk()
static java.lang.String
debugCharDescription(int c)
java.lang.String
errorDetails(java.lang.String message, int index, int ch)
int
findAttributeEnd()
boolean
findChar(char c)
boolean
findCommaOrEndForArray()
int
findEndOfEncodedString()
int
findEndOfEncodedStringFast()
NumberParseResult
findEndOfNumber()
NumberParseResult
findEndOfNumberFast()
int
findEndString()
int
findFalseEnd()
int
findNullEnd()
boolean
findObjectEndOrAttributeSep()
int
findTrueEnd()
char[]
getArray(int startIndex, int endIndex)
java.math.BigDecimal
getBigDecimal(int startIndex, int endIndex)
java.math.BigInteger
getBigInteger(int startIndex, int endIndex)
java.lang.CharSequence
getCharSequence(int startIndex, int endIndex)
char
getChartAt(int index)
char
getCurrentChar()
char
getCurrentCharSafe()
double
getDouble(int from, int to)
java.lang.String
getEncodedString(int start, int end)
float
getFloat(int from, int to)
int
getIndex()
int
getInt(int offset, int to)
long
getLong(int offset, int to)
java.lang.String
getString(int startIndex, int endIndex)
boolean
isInteger(int offset, int end)
boolean
matchChars(int startIndex, int endIndex, java.lang.CharSequence key)
int
next()
Returns next character or ETX.int
nextSkipWhiteSpace()
long
parseLongFromToIgnoreDot(int offset, int to)
char
skipWhiteSpace()
java.lang.String
toEncodedStringIfNeeded(int start, int end)
java.lang.String
toString()
-
-
-
Method Detail
-
next
public int next()
Description copied from interface:CharSource
Returns next character or ETX.- Specified by:
next
in interfaceCharSource
-
checkForJunk
public void checkForJunk()
- Specified by:
checkForJunk
in interfaceCharSource
-
nextSkipWhiteSpace
public int nextSkipWhiteSpace()
- Specified by:
nextSkipWhiteSpace
in interfaceCharSource
-
skipWhiteSpace
public char skipWhiteSpace()
- Specified by:
skipWhiteSpace
in interfaceCharSource
-
getIndex
public int getIndex()
- Specified by:
getIndex
in interfaceCharSource
-
getCurrentChar
public char getCurrentChar()
- Specified by:
getCurrentChar
in interfaceCharSource
-
getCurrentCharSafe
public char getCurrentCharSafe()
- Specified by:
getCurrentCharSafe
in interfaceCharSource
-
getChartAt
public char getChartAt(int index)
- Specified by:
getChartAt
in interfaceCharSource
-
getString
public java.lang.String getString(int startIndex, int endIndex)
- Specified by:
getString
in interfaceCharSource
-
getCharSequence
public java.lang.CharSequence getCharSequence(int startIndex, int endIndex)
- Specified by:
getCharSequence
in interfaceCharSource
-
getArray
public char[] getArray(int startIndex, int endIndex)
- Specified by:
getArray
in interfaceCharSource
-
getBigDecimal
public java.math.BigDecimal getBigDecimal(int startIndex, int endIndex)
- Specified by:
getBigDecimal
in interfaceCharSource
-
getBigInteger
public java.math.BigInteger getBigInteger(int startIndex, int endIndex)
- Specified by:
getBigInteger
in interfaceCharSource
-
getEncodedString
public java.lang.String getEncodedString(int start, int end)
- Specified by:
getEncodedString
in interfaceCharSource
-
toEncodedStringIfNeeded
public java.lang.String toEncodedStringIfNeeded(int start, int end)
- Specified by:
toEncodedStringIfNeeded
in interfaceCharSource
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
findEndOfNumberFast
public NumberParseResult findEndOfNumberFast()
- Specified by:
findEndOfNumberFast
in interfaceCharSource
-
findEndOfEncodedStringFast
public int findEndOfEncodedStringFast()
- Specified by:
findEndOfEncodedStringFast
in interfaceCharSource
-
findEndOfEncodedString
public int findEndOfEncodedString()
- Specified by:
findEndOfEncodedString
in interfaceCharSource
-
findAttributeEnd
public int findAttributeEnd()
- Specified by:
findAttributeEnd
in interfaceCharSource
-
findChar
public boolean findChar(char c)
- Specified by:
findChar
in interfaceCharSource
-
findEndString
public int findEndString()
- Specified by:
findEndString
in interfaceCharSource
-
findEndOfNumber
public NumberParseResult findEndOfNumber()
- Specified by:
findEndOfNumber
in interfaceCharSource
-
findFalseEnd
public int findFalseEnd()
- Specified by:
findFalseEnd
in interfaceCharSource
-
findTrueEnd
public int findTrueEnd()
- Specified by:
findTrueEnd
in interfaceCharSource
-
findObjectEndOrAttributeSep
public boolean findObjectEndOrAttributeSep()
- Specified by:
findObjectEndOrAttributeSep
in interfaceCharSource
-
findCommaOrEndForArray
public boolean findCommaOrEndForArray()
- Specified by:
findCommaOrEndForArray
in interfaceCharSource
-
findNullEnd
public int findNullEnd()
- Specified by:
findNullEnd
in interfaceCharSource
-
matchChars
public boolean matchChars(int startIndex, int endIndex, java.lang.CharSequence key)
- Specified by:
matchChars
in interfaceCharSource
-
isInteger
public boolean isInteger(int offset, int end)
- Specified by:
isInteger
in interfaceCharSource
-
getDouble
public double getDouble(int from, int to)
- Specified by:
getDouble
in interfaceCharSource
-
getFloat
public float getFloat(int from, int to)
- Specified by:
getFloat
in interfaceCharSource
-
getInt
public int getInt(int offset, int to)
- Specified by:
getInt
in interfaceCharSource
-
parseLongFromToIgnoreDot
public long parseLongFromToIgnoreDot(int offset, int to)
-
getLong
public long getLong(int offset, int to)
- Specified by:
getLong
in interfaceCharSource
-
errorDetails
public java.lang.String errorDetails(java.lang.String message, int index, int ch)
- Specified by:
errorDetails
in interfaceCharSource
-
debugCharDescription
public static java.lang.String debugCharDescription(int c)
-
-