Interface MemoryStreaming

All Known Subinterfaces:
RuleSession<S>, StatefulSession, StatelessSession
All Known Implementing Classes:
AbstractSessionWrapper

public interface MemoryStreaming
Provides streaming methods for handling in-memory facts. This interface is extended by both StatefulSession and StatelessSession. Note that for stateless sessions, invoking any streaming method will trigger the session to fire, and no further operations on the session will be possible afterward.
  • Method Details

    • streamFactEntries

      Stream<Map.Entry<FactHandle,Object>> streamFactEntries()
      Streams all fact entries as a Stream of Map.Entry objects.
      Returns:
      a stream of all fact entries and their fact handles
    • streamFactEntries

      <T> Stream<Map.Entry<FactHandle,T>> streamFactEntries(String type)
      Streams all fact entries of a specific type as a Stream of Map.Entry objects.
      Type Parameters:
      T - the type of facts to stream
      Parameters:
      type - the logical type of the facts
      Returns:
      a stream of fact entries of the specified logical type
      See Also:
    • streamFactEntries

      <T> Stream<Map.Entry<FactHandle,T>> streamFactEntries(Class<T> type)
      Streams all fact entries of a specific Java type as a Stream of Map.Entry objects.
      Type Parameters:
      T - the type of facts to stream
      Parameters:
      type - the Java type of the facts
      Returns:
      a stream of fact entries of the specified logical type
    • streamFacts

      default Stream<Object> streamFacts()
      Streams all facts as a Stream of Object values.
      Returns:
      a stream of all facts
    • streamFacts

      default <T> Stream<T> streamFacts(String type)
      Streams all facts of a specific type as a Stream of Object values.
      Type Parameters:
      T - the type of facts to stream
      Parameters:
      type - the logical type of the facts as a string
      Returns:
      a stream of facts of the specified logical type
      See Also:
    • streamFacts

      default <T> Stream<T> streamFacts(Class<T> type)
      Streams all facts of a specific type as a Stream of Object values.
      Type Parameters:
      T - the type of facts to stream
      Parameters:
      type - the Java type of the facts
      Returns:
      a stream of facts of the specified type