Class SignedAsset

java.lang.Object
edu.uky.cs.nil.tt.world.Asset
edu.uky.cs.nil.tt.world.SignedAsset
All Implemented Interfaces:
Described, Logical, Unique
Direct Known Subclasses:
Action, Ending, Variable

public abstract class SignedAsset extends Asset
A signed asset is an asset which has a unique signature among all other assets of that type in a story world. A signed asset's name is equivalent to the result of its signature's toString() method.
Author:
Stephen G. Ware
  • Field Details

    • signature

      public final Signature signature
      The asset's unique signature
  • Constructor Details

    • SignedAsset

      public SignedAsset(int id, Signature signature, String description)
      Constructs a new signed asset.
      Parameters:
      id - the asset's unique ID number
      signature - the asset's unique signature
      description - the asset's description
  • Method Details

    • setSignature

      protected abstract SignedAsset setSignature(Signature signature)
      Returns a new signed asset that is the same as this asset, except that its signature and name are the given value.
      Parameters:
      signature - the signature and name the new asset should have
      Returns:
      a signed asset identical to this asset, except with the given signature and name
    • substitute

      public abstract SignedAsset 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
      Specified by:
      substitute in class Asset
      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