java.lang.Object
java.lang.Record
qupath.bioimageio.spec.tensor.sizes.FixedSize
All Implemented Interfaces:
Size

public record FixedSize(int size) extends Record implements Size
A fixed axis size. Basically an int with extra steps.
  • Field Summary

    Fields inherited from interface qupath.bioimageio.spec.tensor.sizes.Size

    NO_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
    FixedSize(int size)
    Create a fixed size instance
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Gets the minimum shape for this axis.
    int
    Get the step size of this axis size.
    int
    getTargetSize(int target)
    Get a size as close as possible to a target.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the size record component.
    final String
    Returns a string representation of this record class.
    void
    validate(List<? extends BaseTensor> tensors)
    Validate a tensor's size, ensuring that all internal fields are valid and resolving links between tensor objects.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FixedSize

      public FixedSize(int size)
      Create a fixed size instance
      Parameters:
      size - The fixed size in pixels.
  • Method Details

    • getTargetSize

      public int getTargetSize(int target)
      Description copied from interface: Size
      Get a size as close as possible to a target.
      Specified by:
      getTargetSize in interface Size
      Parameters:
      target - The target size.
      Returns:
      The fixed output size, Size.NO_SIZE or as close as we can get to the target size.
    • getStep

      public int getStep()
      Description copied from interface: Size
      Get the step size of this axis size.
      Specified by:
      getStep in interface Size
      Returns:
      Size.NO_SIZE for any axis without a step size, otherwise the size.
    • getMin

      public int getMin()
      Description copied from interface: Size
      Gets the minimum shape for this axis.
      Specified by:
      getMin in interface Size
      Returns:
      the minimum size in pixels
    • validate

      public void validate(List<? extends BaseTensor> tensors)
      Description copied from interface: Size
      Validate a tensor's size, ensuring that all internal fields are valid and resolving links between tensor objects.
      Specified by:
      validate in interface Size
      Parameters:
      tensors - Tensors that may be referenced by this Size object.
    • 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. All components in this record class 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.
    • size

      public int size()
      Returns the value of the size record component.
      Specified by:
      size in interface Size
      Returns:
      the value of the size record component