Class AccStateDriver<I,E,K,V>
java.lang.Object
org.aksw.jenax.graphql.sparql.v2.acc.state.api.impl.AccStateDriver<I,E,K,V>
- Type Parameters:
D- tuple typeC- component type
The driver is the class that has a reference to the accumulator that will receive the next input.
This class implements the driver for accumulating tree structures or objects from a sequence of tuples.
The AccJson objects can be seen as states in a state automaton, and this class drives
the transition between the states based on the input.
FIXME Design Issues:
- Is the tuple type needed on class level? probably on method level is sufficient if we use accessors.
- Should we wrap individual components as tuples? The alternative is to use Object - but without passing
Class objects we can't decide which is which...
UPDATE We can decide if we use tupleBridges with dimension == 1
- Access to tuple components: Probably this could be separated using a tuple accessor.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AccContext<K,V> protected Objectprotected AccStateGon<I,E, K, V> protected BiFunction<I,E, ?> protected booleanprotected Eprotected Iprotected Objectprotected long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAccStateDriver(AccContext<K, V> context, AccStateGon<I, E, K, V> rootAcc, boolean isSingle, BiFunction<I, E, ?> inputToStateId) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccumulate(I input, E env) We expect each root node to be announced with a dummy quad that does not carry any edge information (s, s, ANY, ANY)booleanend()protected voidRecursively calls end() on the current accumulator and all its ancestorsAccContext<K,V> BiFunction<I,E, ?> longstatic <I,E, K, V> AccStateDriver<I, E, K, V> of(AccContext<K, V> context, AccStateGon<I, E, K, V> rootAcc, boolean isSingle, BiFunction<I, E, ?> inputToStateId) booleanprocessInput(Object inputStateId, I input, E env, boolean isNewSource) protected booleanvoidsetContext(AccContext<K, V> context)
-
Field Details
-
context
-
currentState
-
currentSource
-
sourcesSeen
protected long sourcesSeen -
isSingle
protected boolean isSingle -
inputToStateId
-
pendingInputStateId
-
pendingInput
-
pendingEnv
-
-
Constructor Details
-
AccStateDriver
protected AccStateDriver(AccContext<K, V> context, AccStateGon<I, E, K, V> rootAcc, boolean isSingle, BiFunction<I, E, ?> inputToStateId)
-
-
Method Details
-
of
public static <I,E, AccStateDriver<I,K, V> E, ofK, V> (AccContext<K, V> context, AccStateGon<I, E, K, V> rootAcc, boolean isSingle, BiFunction<I, E, ?> inputToStateId) -
getInputToStateId
-
getContext
-
getSourcesSeen
public long getSourcesSeen() -
setContext
-
processPendingInput
- Throws:
IOException
-
accumulate
We expect each root node to be announced with a dummy quad that does not carry any edge information (s, s, ANY, ANY)- Parameters:
input-cxt-- Throws:
IOException
-
processInput
public boolean processInput(Object inputStateId, I input, E env, boolean isNewSource) throws IOException - Throws:
IOException
-
end
- Throws:
IOException
-
endCurrentItem
Recursively calls end() on the current accumulator and all its ancestors- Throws:
IOException
-