Record Class TimeScript

java.lang.Object
java.lang.Record
kr.toxicity.model.api.script.TimeScript
Record Components:
time - time
script - source script
All Implemented Interfaces:
Comparable<Timed>, Consumer<Tracker>, Timed, AnimationScript

public record TimeScript(float time, @NotNull AnimationScript script) extends Record implements AnimationScript, Timed
Script with time
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TimeScript
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    TimeScript(float time, @NotNull AnimationScript script)
    Creates an instance of a TimeScript record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(@NotNull Tracker tracker)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Checks this script should be called in tick thread
    Returns the value of the script record component.
    float
    Returns the value of the time record component.
    @NotNull TimeScript
    time(float newTime)
    Creates a timed script
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.function.Consumer

    andThen

    Methods inherited from interface kr.toxicity.model.api.animation.Timed

    compareTo
  • Field Details

  • Constructor Details

    • TimeScript

      public TimeScript(float time, @NotNull @NotNull AnimationScript script)
      Creates an instance of a TimeScript record class.
      Parameters:
      time - the value for the time record component
      script - the value for the script record component
  • Method Details

    • isSync

      public boolean isSync()
      Description copied from interface: AnimationScript
      Checks this script should be called in tick thread
      Specified by:
      isSync in interface AnimationScript
      Returns:
      requires tick thread
    • accept

      public void accept(@NotNull @NotNull Tracker tracker)
      Specified by:
      accept in interface AnimationScript
      Specified by:
      accept in interface Consumer<Tracker>
    • time

      @NotNull public @NotNull TimeScript time(float newTime)
      Description copied from interface: AnimationScript
      Creates a timed script
      Specified by:
      time in interface AnimationScript
      Parameters:
      newTime - time
      Returns:
      timed script
    • 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 '=='.
      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.
    • time

      public float time()
      Returns the value of the time record component.
      Specified by:
      time in interface Timed
      Returns:
      the value of the time record component
    • script

      @NotNull public @NotNull AnimationScript script()
      Returns the value of the script record component.
      Returns:
      the value of the script record component