- java.lang.Object
-
- swim.codec.Input
-
- swim.codec.InputBuffer
-
public abstract class InputBuffer extends Input
Non-blocking token stream buffer.
-
-
Constructor Summary
Constructors Constructor Description InputBuffer()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract byte[]array()abstract intarrayOffset()abstract intcapacity()abstract InputBufferclone()Returns an independently positioned view into the token stream, initialized with identical state to thisInput.static InputBufferdone()Returns anInputBufferin the done state.static InputBufferdone(Object id, Mark mark)Returns anInputBufferin the done state, at themarkposition of a token stream logically identified byid.static InputBufferdone(Object id, Mark mark, InputSettings settings)Returns anInputBufferin the done state, at themarkposition of a token stream logically identified byid, with the givensettings.static InputBufferdone(InputSettings settings)Returns anInputBufferin the done state, with the givensettings.static InputBufferempty()Returns anInputBufferin the empty state.static InputBufferempty(Object id, Mark mark)Returns anInputBufferin the empty state, at themarkposition of a token stream logically identified byid.static InputBufferempty(Object id, Mark mark, InputSettings settings)Returns anInputBufferin the empty state, at themarkposition of a token stream logically identified byid, with the givensettings.static InputBufferempty(InputSettings settings)Returns anInputBufferin the empty state, with the givensettings.static InputBuffererror(Throwable error)Returns anInputBufferin the error state, with the given inputerror.static InputBuffererror(Throwable error, Object id, Mark mark)Returns anInputBufferin the error state, with the given inputerror, at themarkposition of a token stream logically identified byid.static InputBuffererror(Throwable error, Object id, Mark mark, InputSettings settings)Returns anInputBufferin the error state, with the given inputerror, at themarkposition of a token stream logically identified byid, with the givensettings.static InputBuffererror(Throwable error, InputSettings settings)Returns anInputBufferin the error state, with the given inputerrorandsettings.InputBufferfork(Object condition)Returns anInputequivalent to thisInput, but whose behavior may be altered by the given out-of-bandcondition.abstract intget(int index)abstract booleanhas(int index)abstract InputBufferid(Object id)Returns anInputequivalent to thisInput, but logically identified by the given–possiblynull–id.abstract intindex()abstract InputBufferindex(int index)abstract InputBufferisPart(boolean isPart)Returns a partialInputequivalent to thisInput, ifisPartistrue; returns a finalInputequivalent to thisInputifisPartisfalse.abstract intlimit()abstract InputBufferlimit(int limit)abstract InputBuffermark(Mark mark)Returns anInputequivalent to thisInput, but logically positioned at the givenmark.abstract intremaining()abstract InputBufferseek(Mark mark)Returns anInputequivalent to thisInput, but repositioned to the givenmark.abstract voidset(int index, int token)abstract InputBuffersettings(InputSettings settings)Returns anInputequivalent to thisInput, but with the given inputsettings.abstract InputBufferstep()Returns anInputequivalent to thisInput, but advanced to the next token.abstract InputBufferstep(int offset)
-
-
-
Method Detail
-
isPart
public abstract InputBuffer isPart(boolean isPart)
Description copied from class:InputReturns a partialInputequivalent to thisInput, ifisPartistrue; returns a finalInputequivalent to thisInputifisPartisfalse. The caller's reference tothisInputshould be replaced by the returnedInput.
-
index
public abstract int index()
-
index
public abstract InputBuffer index(int index)
-
limit
public abstract int limit()
-
limit
public abstract InputBuffer limit(int limit)
-
capacity
public abstract int capacity()
-
remaining
public abstract int remaining()
-
array
public abstract byte[] array()
-
arrayOffset
public abstract int arrayOffset()
-
has
public abstract boolean has(int index)
-
get
public abstract int get(int index)
-
set
public abstract void set(int index, int token)
-
step
public abstract InputBuffer step()
Description copied from class:InputReturns anInputequivalent to thisInput, but advanced to the next token. Returns anInputin the error state if thisInputis not in the cont state. The caller's reference tothisInputshould be replaced by the returnedInput.
-
step
public abstract InputBuffer step(int offset)
-
seek
public abstract InputBuffer seek(Mark mark)
Description copied from class:InputReturns anInputequivalent to thisInput, but repositioned to the givenmark. Returns anInputin the error state if thisInputdoes not support seeking, or if thisInputis unable to reposition to the givenmark. The caller's reference tothisInputshould be replaced by the returnedInput.
-
fork
public InputBuffer fork(Object condition)
Description copied from class:InputReturns anInputequivalent to thisInput, but whose behavior may be altered by the given out-of-bandcondition. The caller's reference tothisInputshould be replaced by the returnedInput.
-
id
public abstract InputBuffer id(Object id)
Description copied from class:InputReturns anInputequivalent to thisInput, but logically identified by the given–possiblynull–id. The caller's reference tothisInputshould be replaced by the returnedInput.
-
mark
public abstract InputBuffer mark(Mark mark)
Description copied from class:InputReturns anInputequivalent to thisInput, but logically positioned at the givenmark. The physical position in the input stream is not modified. The caller's reference tothisInputshould be replaced by the returnedInput.
-
settings
public abstract InputBuffer settings(InputSettings settings)
Description copied from class:InputReturns anInputequivalent to thisInput, but with the given inputsettings. The caller's reference tothisInputshould be replaced by the returnedInput.
-
clone
public abstract InputBuffer clone()
Description copied from class:InputReturns an independently positioned view into the token stream, initialized with identical state to thisInput.
-
empty
public static InputBuffer empty()
Returns anInputBufferin the empty state.
-
empty
public static InputBuffer empty(InputSettings settings)
Returns anInputBufferin the empty state, with the givensettings.
-
empty
public static InputBuffer empty(Object id, Mark mark)
Returns anInputBufferin the empty state, at themarkposition of a token stream logically identified byid.
-
empty
public static InputBuffer empty(Object id, Mark mark, InputSettings settings)
Returns anInputBufferin the empty state, at themarkposition of a token stream logically identified byid, with the givensettings.
-
done
public static InputBuffer done()
Returns anInputBufferin the done state.
-
done
public static InputBuffer done(InputSettings settings)
Returns anInputBufferin the done state, with the givensettings.
-
done
public static InputBuffer done(Object id, Mark mark)
Returns anInputBufferin the done state, at themarkposition of a token stream logically identified byid.
-
done
public static InputBuffer done(Object id, Mark mark, InputSettings settings)
Returns anInputBufferin the done state, at themarkposition of a token stream logically identified byid, with the givensettings.
-
error
public static InputBuffer error(Throwable error)
Returns anInputBufferin the error state, with the given inputerror.
-
error
public static InputBuffer error(Throwable error, InputSettings settings)
Returns anInputBufferin the error state, with the given inputerrorandsettings.
-
error
public static InputBuffer error(Throwable error, Object id, Mark mark)
Returns anInputBufferin the error state, with the given inputerror, at themarkposition of a token stream logically identified byid.
-
error
public static InputBuffer error(Throwable error, Object id, Mark mark, InputSettings settings)
Returns anInputBufferin the error state, with the given inputerror, at themarkposition of a token stream logically identified byid, with the givensettings.
-
-