org.msgpack.value
Interface Cursor

All Superinterfaces:
java.io.Closeable, java.util.Iterator<Value>
All Known Implementing Classes:
CursorImpl

public interface Cursor
extends java.util.Iterator<Value>, java.io.Closeable

Cursor for traversing a stream of message-packed values


Nested Class Summary
static interface Cursor.Function<Out>
           
 
Method Summary
<Out> Out
apply(Cursor.Function<Out> f)
          Applies a function f to the referenced value, then returns the result of the function.
 long getReadBytes()
          Returns the number of the read bytes
 boolean hasNext()
          Tests whether there is a next element.
 boolean isArrayValue()
           
 boolean isBinaryValue()
           
 boolean isBooleanValue()
           
 boolean isExtendedValue()
           
 boolean isFloatValue()
           
 boolean isIntegerValue()
           
 boolean isMapValue()
           
 boolean isNilValue()
           
 boolean isNumberValue()
           
 boolean isRawValue()
           
 boolean isStringValue()
           
 Value next()
          Returns the materialized value of the referenced value, then proceeds the cursor.
 ValueRef nextRef()
          Returns a reference to the value, then proceeds the cursor.
 void skip()
          Skip reading the current value.
 
Methods inherited from interface java.util.Iterator
remove
 
Methods inherited from interface java.io.Closeable
close
 

Method Detail

hasNext

boolean hasNext()
Tests whether there is a next element.

Specified by:
hasNext in interface java.util.Iterator<Value>
Returns:
true if there is a next element, or false if there is no more element.

nextRef

ValueRef nextRef()
Returns a reference to the value, then proceeds the cursor. The returned reference is valid until hasNext() is called.

Returns:

next

Value next()
Returns the materialized value of the referenced value, then proceeds the cursor.

Specified by:
next in interface java.util.Iterator<Value>
Returns:

skip

void skip()
Skip reading the current value.


getReadBytes

long getReadBytes()
Returns the number of the read bytes

Returns:
the number of the read bytes

apply

<Out> Out apply(Cursor.Function<Out> f)
Applies a function f to the referenced value, then returns the result of the function.

Type Parameters:
Out - the result type of the function
Parameters:
f - a function that receives the referenced value.
Returns:
the result of the function

isNilValue

boolean isNilValue()

isBooleanValue

boolean isBooleanValue()

isNumberValue

boolean isNumberValue()

isIntegerValue

boolean isIntegerValue()

isFloatValue

boolean isFloatValue()

isBinaryValue

boolean isBinaryValue()

isStringValue

boolean isStringValue()

isRawValue

boolean isRawValue()

isArrayValue

boolean isArrayValue()

isMapValue

boolean isMapValue()

isExtendedValue

boolean isExtendedValue()