Interface Deadline

All Superinterfaces:
DeadlineDescription, io.hotmoka.marshalling.api.Marshallable

public interface Deadline extends DeadlineDescription, io.hotmoka.marshalling.api.Marshallable
A deadline inside a plot file. It is a reference to a nonce and a value computed for that nonce. Deadlines are ordered by the lexicographical ordering of their values.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The maximal length of the prolog of a deadline, in bytes (inclusive).
    static final int
    The maximal scoop number in a deadline (inclusive).
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Compares the value of this deadline with that of another deadline.
    boolean
    equals(Object other)
    Checks if this deadline is equal to another object (same progressive, same value).
    long
    Yields the progressive number of the nonce of the deadline.
    byte[]
    Yields the prolog that was used to create the plot file from which this deadline has been generated.
    byte[]
    Yields the value of the deadline computed for the nonce getProgressive() of the plot file.
    boolean
    Determines if this deadline is valid, that is, its corresponding nonce is for the same deadline.
    boolean
    Determines if this deadline matches the given description: same scoop number, same data and same hashing algorithm.
    Yields a string representation of this deadline.

    Methods inherited from interface io.mokamint.nonce.api.DeadlineDescription

    getData, getHashing, getScoopNumber

    Methods inherited from interface io.hotmoka.marshalling.api.Marshallable

    into, toByteArray
  • Field Details

    • MAX_PROLOG_SIZE

      static final int MAX_PROLOG_SIZE
      The maximal length of the prolog of a deadline, in bytes (inclusive).
      See Also:
    • MAX_SCOOP_NUMBER

      static final int MAX_SCOOP_NUMBER
      The maximal scoop number in a deadline (inclusive).
      See Also:
  • Method Details

    • getProlog

      byte[] getProlog()
      Yields the prolog that was used to create the plot file from which this deadline has been generated.
      Returns:
      the prolog
    • getProgressive

      long getProgressive()
      Yields the progressive number of the nonce of the deadline.
      Returns:
      the progressive number
    • getValue

      byte[] getValue()
      Yields the value of the deadline computed for the nonce getProgressive() of the plot file.
      Returns:
      the value
    • equals

      boolean equals(Object other)
      Checks if this deadline is equal to another object (same progressive, same value).
      Overrides:
      equals in class Object
      Parameters:
      other - the other object
      Returns:
      true if and only if other is a Deadline with the same data
    • compareByValue

      int compareByValue(Deadline other)
      Compares the value of this deadline with that of another deadline. They are assumed to have been generated with the same hashing algorithm.
      Parameters:
      other - the other deadline
      Returns:
      negative if the value of this deadline is smaller than the value of the other deadline; positive if the value of this deadline if larger than the value of the other deadline; 0 if the value are equal
    • matches

      boolean matches(DeadlineDescription description)
      Determines if this deadline matches the given description: same scoop number, same data and same hashing algorithm.
      Parameters:
      description - the description matched to this deadline
      Returns:
      true if and inly if that condition holds
    • isValid

      boolean isValid()
      Determines if this deadline is valid, that is, its corresponding nonce is for the same deadline.
      Returns:
      true if and only if this deadline is valid
    • toString

      String toString()
      Yields a string representation of this deadline.
      Specified by:
      toString in interface DeadlineDescription
      Overrides:
      toString in class Object
      Returns:
      the string representation