public final class GetSize extends Object implements BSONParseListener
JSONParser
.
This class performs a minimal amount of error checking.
Constructor and Description |
---|
GetSize() |
Modifier and Type | Method and Description |
---|---|
boolean |
abort()
returns false
|
void |
ended()
Stops parsing, and prevents any further parsing events from happening until
started() is called again. |
int |
getCount()
returns the current number of items counted
|
void |
newKeyValue(byte a,
String b,
DataInput c)
Parses a value of type typeOfValue from reader, treats that as a value, and then
does whatever with the key-value pair.
|
void |
started()
restarts the item count
|
public void started() throws IllegalStateException
started
in interface BSONParseListener
IllegalStateException
- if #started is called twice between invocation of #endedpublic void ended() throws IllegalStateException, ParseException
started()
is called again.ended
in interface BSONParseListener
IllegalStateException
- if this cannot accept parse eventsParseException
public void newKeyValue(byte a, String b, DataInput c) throws NullPointerException, IOException, ParseException, UnsupportedOperationException
BSONParseListener
newKeyValue
in interface BSONParseListener
b
- the pair's keyc
- the input values, to obtain a value fromNullPointerException
IOException
ParseException
UnsupportedOperationException
public int getCount()
public boolean abort() throws IllegalStateException
abort
in interface BSONParseListener
IllegalStateException
- never