Module com.github.akurilov.commons
Class SynchronousExpressionInputImpl<T>
- java.lang.Object
-
- com.github.akurilov.commons.io.el.ExpressionInputImpl<T>
-
- com.github.akurilov.commons.io.el.SynchronousExpressionInputImpl<T>
-
- All Implemented Interfaces:
ExpressionInput<T>,SynchronousExpressionInput<T>,Input<T>,java.lang.AutoCloseable,java.util.concurrent.Callable<T>,java.util.function.Supplier<T>
public class SynchronousExpressionInputImpl<T> extends ExpressionInputImpl<T> implements SynchronousExpressionInput<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.akurilov.commons.io.el.ExpressionInput
ExpressionInput.Builder
-
-
Field Summary
-
Fields inherited from interface com.github.akurilov.commons.io.el.ExpressionInput
ASYNC_MARKER, EXPRESSION_PATTERN, FACTORY, INIT_MARKER, SELF_REF_ID, SYNC_MARKER
-
-
Constructor Summary
Constructors Constructor Description SynchronousExpressionInputImpl(java.lang.String exprStr, T initial, de.odysseus.el.util.SimpleContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tget()Get a value.intget(java.util.List<T> buffer, int limit)Bulk values get.longskip(long count)Skip some items.-
Methods inherited from class com.github.akurilov.commons.io.el.ExpressionInputImpl
call, close, expr, last, reset, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.akurilov.commons.io.el.ExpressionInput
call, expr, last, reset
-
-
-
-
Constructor Detail
-
SynchronousExpressionInputImpl
public SynchronousExpressionInputImpl(java.lang.String exprStr, T initial, de.odysseus.el.util.SimpleContext ctx)
-
-
Method Detail
-
get
public final T get() throws javax.el.PropertyNotFoundException, javax.el.ELException
Description copied from interface:ExpressionInputGet a value. A user should invoke call() method by itself to evaluate the expression if the given expression input is not synchronous. The initial value only would be returned otherwise.- Specified by:
getin interfaceExpressionInput<T>- Specified by:
getin interfaceInput<T>- Specified by:
getin interfacejava.util.function.Supplier<T>- Specified by:
getin interfaceSynchronousExpressionInput<T>- Overrides:
getin classExpressionInputImpl<T>- Returns:
- next item or null if no items available more
- Throws:
javax.el.PropertyNotFoundExceptionjavax.el.ELException
-
get
public final int get(java.util.List<T> buffer, int limit) throws javax.el.PropertyNotFoundException, javax.el.ELException
Description copied from interface:ExpressionInputBulk values get. A user should invoke call() method by itself to evaluate the expression if the given expression input is not synchronous. The initial value only would be returned otherwise.- Specified by:
getin interfaceExpressionInput<T>- Specified by:
getin interfaceInput<T>- Specified by:
getin interfaceSynchronousExpressionInput<T>- Overrides:
getin classExpressionInputImpl<T>- Parameters:
buffer- buffer for the valueslimit- max count of the values to put into the buffer- Returns:
- count of the items have been get and put into the buffer actually
- Throws:
javax.el.PropertyNotFoundExceptionjavax.el.ELException
-
skip
public final long skip(long count) throws javax.el.PropertyNotFoundException, javax.el.ELExceptionDescription copied from interface:ExpressionInputSkip some items.- Specified by:
skipin interfaceExpressionInput<T>- Specified by:
skipin interfaceInput<T>- Specified by:
skipin interfaceSynchronousExpressionInput<T>- Overrides:
skipin classExpressionInputImpl<T>- Parameters:
count- count of items should be skipped from the input stream- Throws:
javax.el.PropertyNotFoundExceptionjavax.el.ELException
-
-