Interface Data.Packet<T>

Type Parameters:
T - type of wrapped data
All Superinterfaces:
Lookup.Provider
Enclosing class:
Data

public static interface Data.Packet<T> extends Lookup.Provider
A data holder used to wrap data of type T to be passed around a Pipe graph.

Implementations of this interface are provided by the Data.Sink.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Accumulate data from the provided packets into this packet.
    void
    apply(Function<? super T,? extends T> operator)
    Apply a function to the data in the packet.
    void
    Clear the data in the packet.
    Create a packet compatible with the data in this packet.
    Access the data in the packet.
    void
    Dispose of the data in this packet.
    boolean
    Check whether a packet is compatible with this packet.

    Methods inherited from interface org.praxislive.core.Lookup.Provider

    getLookup
  • Method Details

    • data

      T data()
      Access the data in the packet.
      Returns:
      data
    • clear

      void clear()
      Clear the data in the packet. This will use any clear function configured for the pipeline.
      See Also:
    • apply

      void apply(Function<? super T,? extends T> operator)
      Apply a function to the data in the packet. If the function returns a different instance of data, the packet data will be replaced and the old data disposed. Disposal will be handled by any disposal function set on the pipeline.
      Parameters:
      operator - data function
      See Also:
    • accumulate

      void accumulate(List<Data.Packet<T>> packets)
      Accumulate data from the provided packets into this packet. If the list contains this packet it will be ignored. Accumulation will be done using any accumulate function set on the pipeline.
      Parameters:
      packets - source packets
      See Also:
    • isCompatible

      boolean isCompatible(Data.Packet<T> packet)
      Check whether a packet is compatible with this packet. If a packet is not compatible, it will be disposed and a new packet created. Compatibility will be checked using any compatibility function set on the pipeline.
      Parameters:
      packet - other packet
      Returns:
      true if compatible
      See Also:
    • createPacket

      Data.Packet<T> createPacket()
      Create a packet compatible with the data in this packet.
      Returns:
      newly created packet
    • dispose

      void dispose()
      Dispose of the data in this packet. The packet will not be usable after disposal. Disposal will be handled using any disposal function set on the pipeline.
      See Also: