Interface ResourceUnit

All Known Implementing Classes:
EntryUnit, MemoryUnit

public interface ResourceUnit
Represents a unit in which quantity is expressed in a SizedResourcePool.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    compareTo(long thisSize, long thatSize, ResourceUnit thatUnit)
    Compares thisSize in this unit to thatSize in thatUnit.
  • Method Details

    • compareTo

      int compareTo(long thisSize, long thatSize, ResourceUnit thatUnit) throws IllegalArgumentException
      Compares thisSize in this unit to thatSize in thatUnit.

      Returns 1, 0, or -1 if the thisSize of this is greater than, equal to, or less than thatSize of thatUnit respectively.

      Parameters:
      thisSize - size in this unit
      thatSize - size in thatUnit
      thatUnit - other ResourceUnit
      Returns:
      as per the compareTo contract
      Throws:
      IllegalArgumentException - if the units are not comparable