Class VulkanMemoryHeap

java.lang.Object
com.io7m.jcoronado.api.VulkanMemoryHeap
All Implemented Interfaces:
VulkanMemoryHeapType

public final class VulkanMemoryHeap extends Object implements VulkanMemoryHeapType
Structure specifying a memory heap.
See Also:
  • "VkMemoryHeap"
  • Method Details

    • index

      public VulkanMemoryHeapIndex index()
      Specified by:
      index in interface VulkanMemoryHeapType
      Returns:
      The heap index
    • size

      public long size()
      Specified by:
      size in interface VulkanMemoryHeapType
      Returns:
      The total memory size in bytes in the heap.
    • flags

      public Set<VulkanMemoryHeapFlag> flags()
      Specified by:
      flags in interface VulkanMemoryHeapType
      Returns:
      The flags for the heap
    • withIndex

      public final VulkanMemoryHeap withIndex(VulkanMemoryHeapIndex value)
      Copy the current immutable object by setting a value for the index attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for index
      Returns:
      A modified copy or the this object
    • withSize

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

      public final VulkanMemoryHeap withFlags(VulkanMemoryHeapFlag... elements)
      Copy the current immutable object with elements that replace the content of flags.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withFlags

      public final VulkanMemoryHeap withFlags(Iterable<VulkanMemoryHeapFlag> elements)
      Copy the current immutable object with elements that replace the content of flags. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of flags 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 VulkanMemoryHeap 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: index, size, flags.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static VulkanMemoryHeap.Builder builder()
      Creates a builder for VulkanMemoryHeap.
      VulkanMemoryHeap.builder()
         .setIndex(com.io7m.jcoronado.api.VulkanMemoryHeapIndex) // required index
         .setSize(long) // optional size
         .addFlags|addAllFlags(com.io7m.jcoronado.api.VulkanMemoryHeapFlag) // flags elements
         .build();
      
      Returns:
      A new VulkanMemoryHeap builder