Class Signature

java.lang.Object
edu.uky.cs.nil.tt.world.Signature
All Implemented Interfaces:
Logical

public final class Signature extends Object implements Logical
A signature is a logical object that identifies a parameterized asset in a story world. A signature is defined by a name and an ordered sequence of 0 to many values, called its arguments. Signatures make it possible to tell how different assets of the same type are similar and different from one another.
Author:
Stephen G. Ware
  • Field Details

    • name

      public final String name
      The signature's name
  • Constructor Details

    • Signature

      public Signature(String name, Value... arguments)
      Constructs a new signature from a name and an array of arguments.
      Parameters:
      name - the signature's name
      arguments - an ordered sequence of 0 to many values
  • Method Details

    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • substitute

      public Signature substitute(Function<Object,Object> substitution)
      Description copied from interface: Logical
      Returns a logical object identical to this one, except that its logical elements have been replaced according to the given substitution. A substitution defines how some logical formula (the input to the function) should be replaced with a different formula (the output of the function).
      Specified by:
      substitute in interface Logical
      Parameters:
      substitution - a function which maps logical formula that should be replaced to the formula they should be replaced with
      Returns:
      an identical object, except that its logical formula have been replaced according to the substitution
    • getArguments

      public List<Value> getArguments()
      Returns an unmodifiable list of this signature's arguments.
      Returns:
      a list of arguments