Class OperationStaticSemanticsBuilder

java.lang.Object
org.kigalisim.lang.operation.OperationStaticSemanticsBuilder

public class OperationStaticSemanticsBuilder extends Object
Builder for an OperationStaticSemantics record.

Builder which allows operations to specify only the statically inferrable properties which apply to them, leaving the rest empty.

  • Constructor Details

    • OperationStaticSemanticsBuilder

      public OperationStaticSemanticsBuilder(OperationType operationType)
      Create a new builder with all optional properties empty.
      Parameters:
      operationType - The type of operation for which the record is being built.
  • Method Details

    • addStream

      public OperationStaticSemanticsBuilder addStream(String stream)
      Indicate that a stream is included in the operation.
      Parameters:
      stream - The name of the stream involved in the operation.
      Returns:
      This builder for chaining.
    • addIfStream

      public OperationStaticSemanticsBuilder addIfStream(String name)
      Indicate that a name is included in the operation if it is a known stream.

      Intended for names which may refer to either a stream or a substance, like a displacement target. Names which are not known streams are ignored.

      Parameters:
      name - The name which may be a stream involved in the operation.
      Returns:
      This builder for chaining.
    • setAssumePriorNew

      public OperationStaticSemanticsBuilder setAssumePriorNew(boolean newFlag)
      Indicate whether the operation treats prior equipment as new.
      Parameters:
      newFlag - True if the assuming new modifier is present and false otherwise.
      Returns:
      This builder for chaining.
    • build

      public OperationStaticSemantics build()
      Build the record from the properties specified so far.
      Returns:
      Newly constructed static semantics record.