Class VMADetailedStatistics

java.lang.Object
com.io7m.jcoronado.vma.VMADetailedStatistics
All Implemented Interfaces:
VMADetailedStatisticsType

public final class VMADetailedStatistics extends Object implements VMADetailedStatisticsType
Detailed statistics for a set of VMA allocations, corresponding to a single memory type, a single memory heap, or the aggregate total.
See Also:
  • "VmaDetailedStatistics"
  • Method Details

    • blockCount

      public int blockCount()
      Specified by:
      blockCount in interface VMADetailedStatisticsType
      Returns:
      The total number of allocated memory blocks.
    • allocationCount

      public int allocationCount()
      Specified by:
      allocationCount in interface VMADetailedStatisticsType
      Returns:
      The total number of allocations.
    • blockBytes

      public long blockBytes()
      Specified by:
      blockBytes in interface VMADetailedStatisticsType
      Returns:
      The total size in bytes of all allocated memory blocks.
    • allocationBytes

      public long allocationBytes()
      Specified by:
      allocationBytes in interface VMADetailedStatisticsType
      Returns:
      The total size in bytes of all allocations.
    • unusedRangeCount

      public int unusedRangeCount()
      Specified by:
      unusedRangeCount in interface VMADetailedStatisticsType
      Returns:
      The number of unused (free) ranges within the memory blocks.
    • allocationSizeMin

      public long allocationSizeMin()
      Specified by:
      allocationSizeMin in interface VMADetailedStatisticsType
      Returns:
      The minimum allocation size, in bytes.
    • allocationSizeMax

      public long allocationSizeMax()
      Specified by:
      allocationSizeMax in interface VMADetailedStatisticsType
      Returns:
      The maximum allocation size, in bytes.
    • unusedRangeSizeMin

      public long unusedRangeSizeMin()
      Specified by:
      unusedRangeSizeMin in interface VMADetailedStatisticsType
      Returns:
      The minimum unused range size, in bytes.
    • unusedRangeSizeMax

      public long unusedRangeSizeMax()
      Specified by:
      unusedRangeSizeMax in interface VMADetailedStatisticsType
      Returns:
      The maximum unused range size, in bytes.
    • withBlockCount

      public final VMADetailedStatistics withBlockCount(int value)
      Copy the current immutable object by setting a value for the blockCount attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for blockCount
      Returns:
      A modified copy or the this object
    • withAllocationCount

      public final VMADetailedStatistics withAllocationCount(int value)
      Copy the current immutable object by setting a value for the allocationCount attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for allocationCount
      Returns:
      A modified copy or the this object
    • withBlockBytes

      public final VMADetailedStatistics withBlockBytes(long value)
      Copy the current immutable object by setting a value for the blockBytes attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for blockBytes
      Returns:
      A modified copy or the this object
    • withAllocationBytes

      public final VMADetailedStatistics withAllocationBytes(long value)
      Copy the current immutable object by setting a value for the allocationBytes attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for allocationBytes
      Returns:
      A modified copy or the this object
    • withUnusedRangeCount

      public final VMADetailedStatistics withUnusedRangeCount(int value)
      Copy the current immutable object by setting a value for the unusedRangeCount attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for unusedRangeCount
      Returns:
      A modified copy or the this object
    • withAllocationSizeMin

      public final VMADetailedStatistics withAllocationSizeMin(long value)
      Copy the current immutable object by setting a value for the allocationSizeMin attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for allocationSizeMin
      Returns:
      A modified copy or the this object
    • withAllocationSizeMax

      public final VMADetailedStatistics withAllocationSizeMax(long value)
      Copy the current immutable object by setting a value for the allocationSizeMax attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for allocationSizeMax
      Returns:
      A modified copy or the this object
    • withUnusedRangeSizeMin

      public final VMADetailedStatistics withUnusedRangeSizeMin(long value)
      Copy the current immutable object by setting a value for the unusedRangeSizeMin attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for unusedRangeSizeMin
      Returns:
      A modified copy or the this object
    • withUnusedRangeSizeMax

      public final VMADetailedStatistics withUnusedRangeSizeMax(long value)
      Copy the current immutable object by setting a value for the unusedRangeSizeMax attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for unusedRangeSizeMax
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of VMADetailedStatistics that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: blockCount, allocationCount, blockBytes, allocationBytes, unusedRangeCount, allocationSizeMin, allocationSizeMax, unusedRangeSizeMin, unusedRangeSizeMax.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value VMADetailedStatistics with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static VMADetailedStatistics copyOf(VMADetailedStatisticsType instance)
      Creates an immutable copy of a VMADetailedStatisticsType value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable VMADetailedStatistics instance
    • builder

      public static VMADetailedStatistics.Builder builder()
      Creates a builder for VMADetailedStatistics.
      VMADetailedStatistics.builder()
         .setBlockCount(int) // required blockCount
         .setAllocationCount(int) // required allocationCount
         .setBlockBytes(long) // required blockBytes
         .setAllocationBytes(long) // required allocationBytes
         .setUnusedRangeCount(int) // required unusedRangeCount
         .setAllocationSizeMin(long) // required allocationSizeMin
         .setAllocationSizeMax(long) // required allocationSizeMax
         .setUnusedRangeSizeMin(long) // required unusedRangeSizeMin
         .setUnusedRangeSizeMax(long) // required unusedRangeSizeMax
         .build();
      
      Returns:
      A new VMADetailedStatistics builder