Annotation Interface ConstantTime


@Retention(RUNTIME) @Target({METHOD,CONSTRUCTOR}) public @interface ConstantTime
Marker interface to indicate that an operation takes constant time. The primary purpose of this interface is to allow generic algorithms to alter their behavior to provide good performance.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether the running time is amortized or actual.
  • Element Details

    • amortized

      boolean amortized
      Whether the running time is amortized or actual.
      Returns:
      true if amortized, false if actual
      Default:
      false