Package io.github.jwharm.javagi.base
Class Alias<T>
java.lang.Object
io.github.jwharm.javagi.base.Alias<T>
- Type Parameters:
T
- The primitive value type
- Direct Known Subclasses:
Bool
,ClockID
,ClockTime
,ClockTimeDiff
,Codepoint
,Color
,DateDay
,DateYear
,ElementFactoryListType
,Glyph
,GlyphUnit
,Mask
,OtNameId
,Pid
,Position
,Quark
,RefString
,Strv
,Tag
,Time
,TimeSpan
,Type
Base class for type aliases of primitive values.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Compare two aliases for equality.static MemorySegment[]
getAddressValues
(Alias<MemorySegment>[] array) Convert an array of MemorySegment Aliases into an array of MemorySegments.static boolean[]
getBooleanValues
(Alias<Boolean>[] array) Convert an array of Boolean Aliases into an array of booleans.static byte[]
getByteValues
(Alias<Byte>[] array) Convert an array of Byte Aliases into an array of bytes.static char[]
getCharacterValues
(Alias<Character>[] array) Convert an array of Character Aliases into an array of chars.static double[]
getDoubleValues
(Alias<Double>[] array) Convert an array of Double Aliases into an array of doubles.static float[]
getFloatValues
(Alias<Float>[] array) Convert an array of Float Aliases into an array of floats.static int[]
getIntegerValues
(Alias<Integer>[] array) Convert an array of Integer Aliases into an array of integers.static long[]
getLongValues
(Alias<Long>[] array) Convert an array of Long Aliases into an array of longs.static short[]
getShortValues
(Alias<Short>[] array) Convert an array of Short Aliases into an array of shorts.getValue()
Get the current value of the alias.int
hashCode()
Calculate the hashcode of the value of the alias.void
Set the alias to the provided value, overwriting any existing value.
-
Constructor Details
-
Alias
Create a new alias with the provided value.- Parameters:
value
- the initial value of the alias
-
-
Method Details
-
setValue
Set the alias to the provided value, overwriting any existing value.- Parameters:
value
- the new value
-
getValue
Get the current value of the alias.- Returns:
- the current value, or
null
if the value has not been set
-
equals
-
hashCode
-
getAddressValues
Convert an array of MemorySegment Aliases into an array of MemorySegments.- Parameters:
array
- the array of Alias objects- Returns:
- an array of MemorySegments
-
getBooleanValues
-
getByteValues
-
getCharacterValues
-
getDoubleValues
-
getFloatValues
-
getIntegerValues
-
getLongValues
-
getShortValues
-