Schnittstelle Chain<T extends @Nullable Object>

Typparameter:
T - The type of state to be transformed in a chain
Alle Superschnittstellen:
Iterable<T>

@API(status=EXPERIMENTAL, since="1.7.0") public interface Chain<T extends @Nullable Object> extends Iterable<T>
A chain represents a series of states of type T in which the previous state is somehow transformed into the next state. Transformers are used to transform a state into the next state. The term chain is used in relation to mathematical concepts like Markov chains.

State instances can be mutable or immutable.

Chains can be generated through startWith(Supplier).

Siehe auch:
  • Verschachtelte Klassen - Übersicht

    Verschachtelte Klassen
    Modifizierer und Typ
    Schnittstelle
    Beschreibung
    static class 
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    default Iterator<T>
     
    int
    The maximum number of transformations that a chain can go through.
    The Iterator will iterate through elements representing states in order, i.e. their number is one higher than the number of transformations applied to the initial state.
    static <T extends @Nullable Object>
    ChainArbitrary<T>
    startWith(Supplier<? extends T> initialSupplier)
    Create arbitrary for chains with a certain initial state.
    Return list of all applied transformations as far as iterators have been used.
    Return list of all used transformer instances.

    Von Schnittstelle geerbte Methoden java.lang.Iterable

    forEach, spliterator
  • Methodendetails

    • startWith

      static <T extends @Nullable Object> ChainArbitrary<T> startWith(Supplier<? extends T> initialSupplier)
      Create arbitrary for chains with a certain initial state.
      Typparameter:
      T - The type of state to be transformed through the chain.
      Parameter:
      initialSupplier - function to create the initial state object
      Gibt zurück:
      new arbitrary instance
    • start

      Iterator<T> start()
      The Iterator will iterate through elements representing states in order, i.e. their number is one higher than the number of transformations applied to the initial state.

      Mind that the next state element can depend on both the previous state and (pseudo-)randomness. Several iterators must always produce the same "chain" of states. Each iterator will start with a new instance of the initial state.

      Gibt zurück:
      an iterator through all states
    • iterator

      default Iterator<T> iterator()
      Angegeben von:
      iterator in Schnittstelle Iterable<T extends @Nullable Object>
    • transformations

      List<String> transformations()
      Return list of all applied transformations as far as iterators have been used.

      For a chain that has not been iterated through this list is empty.

      Gibt zurück:
      list of describing strings
    • transformers

      @API(status=EXPERIMENTAL, since="1.7.1") List<Transformer<T>> transformers()
      Return list of all used transformer instances.

      Checking transformer instances - e.g. if they are of a certain implementation type - only makes sense if the transformer's description string is NOT set explicitly.

      For a chain that has not been run this list is always empty.

      Gibt zurück:
      list of transformer instances
    • maxTransformations

      int maxTransformations()
      The maximum number of transformations that a chain can go through.
      Gibt zurück:
      a number >= 1