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 type
C - component type

public class AccStateDriver<I,E,K,V> extends Object
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 Details

    • context

      protected AccContext<K,V> context
    • currentState

      protected AccStateGon<I,E,K,V> currentState
    • currentSource

      protected Object currentSource
    • sourcesSeen

      protected long sourcesSeen
    • isSingle

      protected boolean isSingle
    • inputToStateId

      protected BiFunction<I,E,?> inputToStateId
    • pendingInputStateId

      protected Object pendingInputStateId
    • pendingInput

      protected I pendingInput
    • pendingEnv

      protected E pendingEnv
  • Constructor Details

  • Method Details

    • of

      public static <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)
    • getInputToStateId

      public BiFunction<I,E,?> getInputToStateId()
    • getContext

      public AccContext<K,V> getContext()
    • getSourcesSeen

      public long getSourcesSeen()
    • setContext

      public void setContext(AccContext<K,V> context)
    • processPendingInput

      protected boolean processPendingInput() throws IOException
      Throws:
      IOException
    • accumulate

      public boolean accumulate(I input, E env) throws IOException
      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

      public boolean end() throws IOException
      Throws:
      IOException
    • endCurrentItem

      protected void endCurrentItem() throws IOException
      Recursively calls end() on the current accumulator and all its ancestors
      Throws:
      IOException