- java.lang.Object
-
- com.io7m.jcoronado.api.VulkanMappedMemoryRange
-
- All Implemented Interfaces:
VulkanMappedMemoryRangeType
public final class VulkanMappedMemoryRange extends java.lang.Object implements VulkanMappedMemoryRangeType
- See Also:
- "VkMappedMemoryRange"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VulkanMappedMemoryRange.Builder
Builds instances of typeVulkanMappedMemoryRange
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VulkanMappedMemoryRange.Builder
builder()
Creates a builder forVulkanMappedMemoryRange
.static VulkanMappedMemoryRange
copyOf(VulkanMappedMemoryRangeType instance)
Creates an immutable copy of aVulkanMappedMemoryRangeType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofVulkanMappedMemoryRange
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:memory
,offset
,size
.VulkanDeviceMemoryType
memory()
static VulkanMappedMemoryRange
of(VulkanDeviceMemoryType memory, long offset, long size)
Construct a new immutableVulkanMappedMemoryRange
instance.long
offset()
long
size()
java.lang.String
toString()
Prints the immutable valueVulkanMappedMemoryRange
with attribute values.VulkanMappedMemoryRange
withMemory(VulkanDeviceMemoryType value)
Copy the current immutable object by setting a value for thememory
attribute.VulkanMappedMemoryRange
withOffset(long value)
Copy the current immutable object by setting a value for theoffset
attribute.VulkanMappedMemoryRange
withSize(long value)
Copy the current immutable object by setting a value for thesize
attribute.
-
-
-
Method Detail
-
memory
public VulkanDeviceMemoryType memory()
- Specified by:
memory
in interfaceVulkanMappedMemoryRangeType
- Returns:
- The memory object to which this range belongs.
-
offset
public long offset()
- Specified by:
offset
in interfaceVulkanMappedMemoryRangeType
- Returns:
- The zero-based byte offset from the beginning of the memory object.
-
size
public long size()
- Specified by:
size
in interfaceVulkanMappedMemoryRangeType
- Returns:
- Either the size of range, or VK_WHOLE_SIZE to affect the range from offset to the end of the current mapping of the allocation.
-
withMemory
public final VulkanMappedMemoryRange withMemory(VulkanDeviceMemoryType value)
Copy the current immutable object by setting a value for thememory
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for memory- Returns:
- A modified copy of the
this
object
-
withOffset
public final VulkanMappedMemoryRange withOffset(long value)
Copy the current immutable object by setting a value for theoffset
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for offset- Returns:
- A modified copy of the
this
object
-
withSize
public final VulkanMappedMemoryRange withSize(long value)
Copy the current immutable object by setting a value for thesize
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for size- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofVulkanMappedMemoryRange
that have equal attribute values.- Overrides:
equals
in classjava.lang.Object
- Returns:
true
ifthis
is equal toanother
instance
-
hashCode
public int hashCode()
Computes a hash code from attributes:memory
,offset
,size
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueVulkanMappedMemoryRange
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
of
public static VulkanMappedMemoryRange of(VulkanDeviceMemoryType memory, long offset, long size)
Construct a new immutableVulkanMappedMemoryRange
instance.- Parameters:
memory
- The value for thememory
attributeoffset
- The value for theoffset
attributesize
- The value for thesize
attribute- Returns:
- An immutable VulkanMappedMemoryRange instance
-
copyOf
public static VulkanMappedMemoryRange copyOf(VulkanMappedMemoryRangeType instance)
Creates an immutable copy of aVulkanMappedMemoryRangeType
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 VulkanMappedMemoryRange instance
-
builder
public static VulkanMappedMemoryRange.Builder builder()
Creates a builder forVulkanMappedMemoryRange
.- Returns:
- A new VulkanMappedMemoryRange builder
-
-