Class PortDescriptor<T extends PortDescriptor<T>>

java.lang.Object
org.praxislive.code.Descriptor<T>
org.praxislive.code.PortDescriptor<T>

public abstract non-sealed class PortDescriptor<T extends PortDescriptor<T>> extends Descriptor<T>
A PortDescriptor wraps a Port in a CodeContext. It includes ID, category, order and info, as well as configuring the port on attachment and reset. The underlying port may be configured from the previous iteration or carried across.
  • Constructor Details

    • PortDescriptor

      protected PortDescriptor(Class<T> type, String id, PortDescriptor.Category category, int index)
      Create a PortDescriptor.
      Parameters:
      type - descriptor type
      id - the ID (must be a valid port ID)
      category - the category
      index - the index within the category (used for ordering - must be unique)
  • Method Details

    • category

      public PortDescriptor.Category category()
      Get the category.
      Returns:
      category
    • index

      public int index()
      Get the index.
      Returns:
      index
    • port

      public abstract Port port()
      Get the wrapped port. Should only be called when attached - behaviour is otherwise undefined.
      Returns:
      port
    • portInfo

      public abstract PortInfo portInfo()
      Get port info.
      Returns:
      info
    • dispose

      public void dispose()
      Dispose the port descriptor. The default implementation calls Port.disconnectAll(). When overriding this method, call the super implementation or otherwise ensure that the port is disconnected.
      Overrides:
      dispose in class Descriptor<T extends PortDescriptor<T>>