Record Class Reallocator.AlignedReallocator
java.lang.Object
java.lang.Record
dev.pfaff.altargui.io.Reallocator.AlignedReallocator
- All Implemented Interfaces:
Reallocator
- Enclosing interface:
Reallocator
public static record Reallocator.AlignedReallocator(Reallocator delegate, long byteAlignment)
extends Record
implements Reallocator
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.pfaff.altargui.io.Reallocator
Reallocator.AlignedReallocator
-
Constructor Summary
ConstructorsConstructorDescriptionAlignedReallocator
(Reallocator delegate, long byteAlignment) Creates an instance of aAlignedReallocator
record class. -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the value of thebyteAlignment
record component.delegate()
Returns the value of thedelegate
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.reallocate
(MemorySegment segment, long byteSize) reallocate
(MemorySegment segment, long byteSize, long byteAlignment) Reallocates the given segment to be the specified size.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface dev.pfaff.altargui.io.Reallocator
withAlignment
-
Constructor Details
-
AlignedReallocator
Creates an instance of aAlignedReallocator
record class.- Parameters:
delegate
- the value for thedelegate
record componentbyteAlignment
- the value for thebyteAlignment
record component
-
-
Method Details
-
reallocate
Description copied from interface:Reallocator
Reallocates the given segment to be the specified size. Upon returning, the original segment may be invalid.- Specified by:
reallocate
in interfaceReallocator
- Parameters:
segment
- the segment to reallocate. This must be eitherMemorySegment.NULL
or the return value of a prior invocation to this method on the sameReallocator
instance.byteSize
- the size (in bytes) of the reallocated segmentbyteAlignment
- the alignment (in bytes) of the reallocated segment- Returns:
- the new segment
-
reallocate
Description copied from interface:Reallocator
LikeReallocator.reallocate(MemorySegment, long, long)
but thebyteAlignment
is at least1
. This alignment may be increased by a particularReallocator
implementation).- Specified by:
reallocate
in interfaceReallocator
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
delegate
Returns the value of thedelegate
record component.- Returns:
- the value of the
delegate
record component
-
byteAlignment
public long byteAlignment()Returns the value of thebyteAlignment
record component.- Returns:
- the value of the
byteAlignment
record component
-