public final class ToScalaCollection<A> extends Object implements BSONParseListener
HashMap
,
ToHashMap
Constructor and Description |
---|
ToScalaCollection(BSONDecoder<A> decoder) |
Modifier and Type | Method and Description |
---|---|
boolean |
abort()
returns whether the parsing can end at this time
|
static ToScalaCollection<Object> |
apply()
Returns a ToScalaCollection using a ToScalaCollectionJSONDecoder
|
static <A> ToScalaCollection<A> |
apply(BSONDecoder<A> decoder) |
void |
ended()
Stops parsing, and prevents any further parsing events from happening until
started() is called again. |
void |
newKeyValue(byte a,
String key,
DataInput c)
Parses a value of type typeOfValue from reader, treats that as a value, and then
does whatever with the key-value pair.
|
scala.collection.immutable.Seq<scala.Tuple2<String,A>> |
result()
Returns the parsed result.
|
scala.collection.immutable.Map<String,A> |
resultMap()
Returns the parsed result converted to a Map.
|
scala.collection.immutable.Seq<A> |
resultSeq()
Returns the parsed result converted to a Seq.
|
void |
started()
restarts the item count
|
public ToScalaCollection(BSONDecoder<A> decoder)
public static ToScalaCollection<Object> apply()
public static <A> ToScalaCollection<A> apply(BSONDecoder<A> decoder)
public void started()
started
in interface BSONParseListener
IllegalStateException
- if #started is called twice between invocation of #endedpublic void ended()
started()
is called again.ended
in interface BSONParseListener
IllegalStateException
- if this cannot accept parse eventsParseException
public void newKeyValue(byte a, String key, DataInput c)
BSONParseListener
newKeyValue
in interface BSONParseListener
key
- the pair's keyc
- the input values, to obtain a value frompublic boolean abort()
BSONParseListener
abort
in interface BSONParseListener
public scala.collection.immutable.Seq<scala.Tuple2<String,A>> result()
public scala.collection.immutable.Seq<A> resultSeq()