Skip to content

Class Field<V extends @Nullable Object>

Javadoc 27 generates this reference during each site build from the exported packages and the annotation processor. The Java guide shows the API in use.

java.lang.Object
dev.gecode.iris.Field<V>
Type Parameters:
V - the type of the entry's value
Direct Known Subclasses:
DynField, FloatField, IntField, NumField, StringField
public abstract class Field<V extends @Nullable Object> extends Object
A typed handle: the name of an entry, and the Java type V that Data.get(Field) returns for it.

Handles come from dev.gecode.iris.build, whose factories fix the value type and depth, as int2("machine") gives an IntField<List<long[]>>. A spec builder uses them in statements and expressions; after reading, data.get(handle) returns the entry as V. A handle whose entry may be absent has a nullable V, and get returns null for it.

  • Constructor Details

    • Field

      protected Field(String name)
      Creates a handle. Only the handle classes of dev.gecode.iris.build extend this class.
      Parameters:
      name - the name of the entry
  • Method Details

    • name

      public final String name()
      Returns the name of the entry.
      Returns:
      the name of the entry
    • readFrom

      protected abstract V readFrom(Data data)
      Reads the entry of this handle from data.
      Parameters:
      data - the data that a read produced
      Returns:
      the value of the entry, or null for an absent entry of an optional handle
      Throws:
      IllegalStateException - if the entry is missing, or has another type or depth