Class VMATotalStatistics

java.lang.Object
com.io7m.jcoronado.vma.VMATotalStatistics
All Implemented Interfaces:
VMATotalStatisticsType

public final class VMATotalStatistics extends Object implements VMATotalStatisticsType
The full statistics reported by a VMA allocator: the aggregate total, plus a per-memory-heap and per-memory-type breakdown.
See Also:
  • "VmaTotalStatistics"
  • Method Details

    • total

      public VMADetailedStatistics total()
      Specified by:
      total in interface VMATotalStatisticsType
      Returns:
      The aggregate statistics across all memory types and heaps.
    • heaps

      public List<VMADetailedStatistics> heaps()
      Specified by:
      heaps in interface VMATotalStatisticsType
      Returns:
      Per-memory-heap statistics, indexed by heap index.
    • memoryTypes

      public List<VMADetailedStatistics> memoryTypes()
      Specified by:
      memoryTypes in interface VMATotalStatisticsType
      Returns:
      Per-memory-type statistics, indexed by memory type index.
    • withTotal

      public final VMATotalStatistics withTotal(VMADetailedStatistics value)
      Copy the current immutable object by setting a value for the total attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for total
      Returns:
      A modified copy or the this object
    • withHeaps

      public final VMATotalStatistics withHeaps(VMADetailedStatistics... elements)
      Copy the current immutable object with elements that replace the content of heaps.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withHeaps

      public final VMATotalStatistics withHeaps(Iterable<? extends VMADetailedStatistics> elements)
      Copy the current immutable object with elements that replace the content of heaps. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of heaps elements to set
      Returns:
      A modified copy or this if not changed
    • withMemoryTypes

      public final VMATotalStatistics withMemoryTypes(VMADetailedStatistics... elements)
      Copy the current immutable object with elements that replace the content of memoryTypes.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withMemoryTypes

      public final VMATotalStatistics withMemoryTypes(Iterable<? extends VMADetailedStatistics> elements)
      Copy the current immutable object with elements that replace the content of memoryTypes. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of memoryTypes elements to set
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of VMATotalStatistics 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: total, heaps, memoryTypes.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static VMATotalStatistics copyOf(VMATotalStatisticsType instance)
      Creates an immutable copy of a VMATotalStatisticsType 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 VMATotalStatistics instance
    • builder

      public static VMATotalStatistics.Builder builder()
      Creates a builder for VMATotalStatistics.
      VMATotalStatistics.builder()
         .setTotal(com.io7m.jcoronado.vma.VMADetailedStatistics) // required total
         .addHeaps|addAllHeaps(VMADetailedStatistics) // heaps elements
         .addMemoryTypes|addAllMemoryTypes(VMADetailedStatistics) // memoryTypes elements
         .build();
      
      Returns:
      A new VMATotalStatistics builder