Record Class ModelOptions

java.lang.Object
java.lang.Record
org.clafer.frontend.ModelOptions
Record Components:
core - --core
traceLength - --tl
minInt - --minint
maxInt - --maxint
decimalDigits - --decimal-digits
simpleScopes - --ss=simple, the default, rather than --ss=none
imports - the files of --import, as written
others - the names of the other options given, e.g., -k

public record ModelOptions(boolean core, OptionalInt traceLength, OptionalLong minInt, OptionalLong maxInt, Optional<Integer> decimalDigits, boolean simpleScopes, List<String> imports, Set<String> others) extends Record
The options of a model file that the frontend uses, from its first line, //# OPTIONS ..., as the compiler reads them (Import.fileOptions): --core, --tl, --minint, --maxint, --decimal-digits, --ss and --import. An option is --name=value or --name value; the other options are kept by name only, the short name if it has one, e.g., -c for --check-duplicates, for the checks of the model and of combine(List, List, String, ModelOptions, List). As in the compiler, --explicit implies -f, -l and --ss=none.
  • Field Details

    • Defaults

      public static final ModelOptions Defaults
      The options of a model without a //# OPTIONS line.
  • Constructor Details

  • Method Details

    • of

      public static ModelOptions of(String text)
      Parameters:
      text - the text of a model file
      Returns:
      the options of its first line
    • explicit

      public boolean explicit()
      Returns:
      --explicit: the model is an explicit model, whose names are the UIDs, without layout and without scope analysis
    • skipResolver

      public boolean skipResolver()
      Returns:
      -f, also of --explicit: the names are the UIDs
    • checkDuplicates

      public boolean checkDuplicates()
      Returns:
      --check-duplicates: no two clafers have the same name
    • checkAfm

      public boolean checkAfm()
      Returns:
      --check-afm: no concrete clafer has more than one instance
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • core

      public boolean core()
      Returns the value of the core record component.
      Returns:
      the value of the core record component
    • traceLength

      Returns the value of the traceLength record component.
      Returns:
      the value of the traceLength record component
    • minInt

      public OptionalLong minInt()
      Returns the value of the minInt record component.
      Returns:
      the value of the minInt record component
    • maxInt

      public OptionalLong maxInt()
      Returns the value of the maxInt record component.
      Returns:
      the value of the maxInt record component
    • decimalDigits

      Returns the value of the decimalDigits record component.
      Returns:
      the value of the decimalDigits record component
    • simpleScopes

      public boolean simpleScopes()
      Returns the value of the simpleScopes record component.
      Returns:
      the value of the simpleScopes record component
    • imports

      public List<String> imports()
      Returns the value of the imports record component.
      Returns:
      the value of the imports record component
    • others

      public Set<String> others()
      Returns the value of the others record component.
      Returns:
      the value of the others record component