Class AccStateBase<I,E,K,V>

java.lang.Object
org.aksw.jenax.graphql.sparql.v2.acc.state.api.AccStateBase<I,E,K,V>
All Implemented Interfaces:
AccState<I,E>, AccStateGon<I,E,K,V>
Direct Known Subclasses:
AccStateArrayInit, AccStateCondition, AccStateInit, AccStateLiteral, AccStateMap, AccStateMemberSet, AccStateTransitionBase, AccStateTypeProduceEntryBase

public abstract class AccStateBase<I,E,K,V> extends Object implements AccStateGon<I,E,K,V>
Base class for acc states that produce GON output. Keeps track of the current input being processed.
  • Field Details

    • parent

      protected AccStateGon<I,E,K,V> parent
    • oldSourceNode

      protected Object oldSourceNode
      The materialized value - requires materialization to be enabled in the context
    • hasBegun

      protected boolean hasBegun
    • currentSourceNode

      protected Object currentSourceNode
    • parentInput

      protected I parentInput
    • currentInput

      protected I currentInput
      Copy of the input passed to the most recent call of #transition(Object, Object).
    • skipOutput

      protected boolean skipOutput
    • context

      protected AccContext<K,V> context
    • stateId

      protected Object stateId
  • Constructor Details

    • AccStateBase

      public AccStateBase()
  • Method Details

    • getStateId

      public Object getStateId()
      Description copied from interface: AccState
      Get the id of the state for which this accumulator is notified.
      Specified by:
      getStateId in interface AccState<I,E>
    • setParent

      public void setParent(AccStateGon<I,E,K,V> parent)
      Specified by:
      setParent in interface AccStateGon<I,E,K,V>
    • setContext

      public void setContext(AccContext<K,V> context)
      Description copied from interface: AccStateGon
      The state to which to backtrack if an input cannot be processed by the current state
      Specified by:
      setContext in interface AccStateGon<I,E,K,V>
    • setContextOnChildren

      protected void setContextOnChildren(AccContext<K,V> context)
    • getParent

      public AccStateGon<I,E,K,V> getParent()
      Description copied from interface: AccStateGon
      The immediate parent of this AccState.
      Specified by:
      getParent in interface AccState<I,E>
      Specified by:
      getParent in interface AccStateGon<I,E,K,V>
    • hasBegun

      public boolean hasBegun()
      Specified by:
      hasBegun in interface AccState<I,E>
    • ensureBegun

      public void ensureBegun()
    • transition

      public final AccStateGon<I,E,K,V> transition(Object inputStateId, I input, E env) throws IOException
      Description copied from interface: AccStateGon
      FIXME What exactly is id? Is it the value by which this acc connects to the parent? The context and skipOutput flag are stored on the accumulator until end is called.
      Specified by:
      transition in interface AccState<I,E>
      Specified by:
      transition in interface AccStateGon<I,E,K,V>
      Parameters:
      inputStateId - The stateId, typically extracted from the input by the driver. (Rationale: Only the driver needs to know how to extract the state from an input).
      Returns:
      Throws:
      IOException
    • begin

      public final void begin(Object fromStateId, I parentInput, E env, boolean skipOutput) throws IOException
      Description copied from interface: AccState
      FIXME What exactly is id? Is it the value by which this acc connects to the parent? The context and skipOutput flag are stored on the accumulator until end is called.
      Specified by:
      begin in interface AccState<I,E>
      Parameters:
      joinTuple - The values by which the tuple that is about to be passed to transition joined with the parent accumulator.
      cxt -
      skipOutput -
      Throws:
      IOException
    • end

      public final void end() throws IOException
      Specified by:
      end in interface AccState<I,E>
      Throws:
      IOException
    • transitionActual

      public abstract AccStateGon<I,E,K,V> transitionActual(Object inputStateId, I input, E env) throws IOException
      Throws:
      IOException
    • beginActual

      protected void beginActual() throws IOException
      Throws:
      IOException
    • endActual

      protected void endActual() throws IOException
      Throws:
      IOException