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 recordRepresents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final StructLayoutstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final long -
Constructor Summary
ConstructorsConstructorDescriptionSDL_DateTime(@NotNull MemorySegment segment) Creates an instance of aSDL_DateTimerecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SDL_DateTimestatic SDL_DateTime.Ptrstatic SDL_DateTimeclone(Arena arena, SDL_DateTime src) intday()day(int value) intday_of_week(int value) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.inthour()hour(int value) intminute()minute(int value) intmonth()month(int value) intnanosecond(int value) intsecond()second(int value) @NotNull MemorySegmentsegment()Returns the value of thesegmentrecord component.final StringtoString()Returns a string representation of this record class.intutc_offset(int value) intyear()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_DateTimerecord class.- Parameters:
segment- the value for thesegmentrecord 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 thesegmentrecord component.
-