Record Class SDL_DateTime
java.lang.Object
java.lang.Record
club.doki7.sdl3.datatype.SDL_DateTime
- All Implemented Interfaces:
IPointer
,ISDL_DateTime
@ValueBasedCandidate
@UnsafeConstructor
public record SDL_DateTime(@NotNull MemorySegment segment)
extends Record
implements ISDL_DateTime
A structure holding a calendar date and time broken down into its components.
Since: This struct is available since SDL 3.2.0.
Structure
typedef struct SDL_DateTime {
int year
;
int month
;
int day
;
int hour
;
int minute
;
int second
;
int nanosecond
;
int day_of_week
;
int utc_offset
;
} SDL_DateTime;
Contracts
The property segment()
should always be not-null
(segment != NULL && !segment.equals(MemorySegment.NULL)
), and properly aligned to
LAYOUT.byteAlignment()
bytes. To represent null pointer, you may use a Java
null
instead. See the documentation of IPointer.segment()
for more details.
The constructor of this class is marked as UnsafeConstructor
, because it does not
perform any runtime check. The constructor can be useful for automatic code generators.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Represents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final StructLayout
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
-
Constructor Summary
ConstructorsConstructorDescriptionSDL_DateTime
(@NotNull MemorySegment segment) Creates an instance of aSDL_DateTime
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SDL_DateTime
static SDL_DateTime.Ptr
static SDL_DateTime
clone
(Arena arena, SDL_DateTime src) int
day()
day
(int value) int
day_of_week
(int value) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
hour()
hour
(int value) int
minute()
minute
(int value) int
month()
month
(int value) int
nanosecond
(int value) int
second()
second
(int value) @NotNull MemorySegment
segment()
Returns the value of thesegment
record component.final String
toString()
Returns a string representation of this record class.int
utc_offset
(int value) int
year()
year
(int value)
-
Field Details
-
LAYOUT
-
BYTES
public static final long BYTES -
PATH$year
-
PATH$month
-
PATH$day
-
PATH$hour
-
PATH$minute
-
PATH$second
-
PATH$nanosecond
-
PATH$day_of_week
-
PATH$utc_offset
-
LAYOUT$year
-
LAYOUT$month
-
LAYOUT$day
-
LAYOUT$hour
-
LAYOUT$minute
-
LAYOUT$second
-
LAYOUT$nanosecond
-
LAYOUT$day_of_week
-
LAYOUT$utc_offset
-
SIZE$year
public static final long SIZE$year -
SIZE$month
public static final long SIZE$month -
SIZE$day
public static final long SIZE$day -
SIZE$hour
public static final long SIZE$hour -
SIZE$minute
public static final long SIZE$minute -
SIZE$second
public static final long SIZE$second -
SIZE$nanosecond
public static final long SIZE$nanosecond -
SIZE$day_of_week
public static final long SIZE$day_of_week -
SIZE$utc_offset
public static final long SIZE$utc_offset -
OFFSET$year
public static final long OFFSET$year -
OFFSET$month
public static final long OFFSET$month -
OFFSET$day
public static final long OFFSET$day -
OFFSET$hour
public static final long OFFSET$hour -
OFFSET$minute
public static final long OFFSET$minute -
OFFSET$second
public static final long OFFSET$second -
OFFSET$nanosecond
public static final long OFFSET$nanosecond -
OFFSET$day_of_week
public static final long OFFSET$day_of_week -
OFFSET$utc_offset
public static final long OFFSET$utc_offset
-
-
Constructor Details
-
SDL_DateTime
Creates an instance of aSDL_DateTime
record class.- Parameters:
segment
- the value for thesegment
record component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
year
public int year() -
year
-
month
public int month() -
month
-
day
public int day() -
day
-
hour
public int hour() -
hour
-
minute
public int minute() -
minute
-
second
public int second() -
second
-
nanosecond
public int nanosecond() -
nanosecond
-
day_of_week
public int day_of_week() -
day_of_week
-
utc_offset
public int utc_offset() -
utc_offset
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
segment
Returns the value of thesegment
record component.
-