Class TupleType

java.lang.Object
io.xpipe.core.data.type.DataType
io.xpipe.core.data.type.TupleType

public class TupleType extends DataType
A tuple type in the context of XPipe is defined as an ordered, fixed-size sequence of elements that can be optionally assigned a name. This permissive design allows for a very flexible usage of the tuple type.
  • Constructor Details

    • TupleType

      public TupleType()
  • Method Details

    • tableType

      public static TupleType tableType(List<String> names)
      Creates a new tuple type that represents a table data type.
    • empty

      public static TupleType empty()
      Creates a new tuple type that contains no entries.
    • of

      public static TupleType of(List<String> names, List<DataType> types)
      Creates a new tuple type for a list of names and types. Any entry in names can be null, while any element in types must be not null.
    • of

      public static TupleType of(List<DataType> types)
      Creates a new tuple type for a list of types with no names. Any element in types must be not null.
    • hasAllNames

      public boolean hasAllNames()
    • sub

      public TupleType sub(List<String> subNames)
    • getName

      public String getName()
      Description copied from class: DataType
      Returns the readable name of this data type that can be used for error messages.
      Specified by:
      getName in class DataType
    • convert

      Description copied from class: DataType
      Checks whether a node can be converted to this data type.
      Specified by:
      convert in class DataType
    • matches

      public boolean matches(DataStructureNode node)
      Description copied from class: DataType
      Checks whether a node conforms to this data type.
      Specified by:
      matches in class DataType
    • isTuple

      public boolean isTuple()
      Description copied from class: DataType
      Checks whether this type is a tuple.
      Overrides:
      isTuple in class DataType
    • visit

      public void visit(DataTypeVisitor visitor)
      Description copied from class: DataType
      Visits this type using a DataTypeVisitor instance.
      Specified by:
      visit in class DataType
    • getSize

      public int getSize()