public final class Time extends Object implements IIvyDataObject, Comparable<Time>
Modifier and Type | Field and Description |
---|---|
static Time |
INVALID
An invalid time object.
|
static Time |
UNINITIALIZED_TIME
An uninitialized time object.
|
Constructor and Description |
---|
Time()
Creates a new Time object representing the actual time.
|
Time(int _hours,
int _minutes,
int _seconds)
Creates a new time object.
|
Time(String literal)
Parses a literal and creates a corresponding new time object.
|
Modifier and Type | Method and Description |
---|---|
Time |
add(Duration duration)
Adds some Duration to this Time object.
|
Time |
clone()
Creates a clone of this object.
|
int |
compareTo(Time otherTime)
Compares two Time objects.
|
boolean |
equals(Object object)
Test for equality.
|
String |
format()
Formats this
Time object with default format.The default format is defined in the configuration under Formats > Time > default . |
String |
format(String formatName)
Formats this
Time object with given format. |
int |
getHours()
Returns the hours of this time object.
|
int |
getMinutes()
Returns the minutes of this time object.
|
int |
getSeconds()
Returns the seconds of this time object.
|
int |
hashCode()
Same as toNumber().
|
Time |
minus(Duration duration)
Subtracts some Duration from this Time object.
|
Duration |
minus(Time time)
Returns a normalized Duration representing the difference between this
Time and the argument.
|
int |
toNumber()
Converts the Time object in a number;
this number correspond the seconds after 00:00:00.
|
String |
toString()
Returns this time as a String in the format hh:mm:ss
|
deepClone
public static final Time UNINITIALIZED_TIME
public static final Time INVALID
public Time(int _hours, int _minutes, int _seconds)
_hours
- _minutes
- _seconds
- public Time()
public Time(String literal)
literal
- A literal to parse in the format hh:mm:ss or hh:mm.IllegalArgumentException
- if the argument has an illegal format.public int getHours()
public int getMinutes()
public int getSeconds()
public Time add(Duration duration)
duration
- A duration.public Time minus(Duration duration)
duration
- A duration.public Duration minus(Time time)
time
- public int toNumber()
public boolean equals(Object object)
public int hashCode()
public String format()
Time
object with default format.Formats > Time > default
.public String format(String formatName)
Time
object with given format.formatName
- Name of a configuration under Formats > Time
. public int compareTo(Time otherTime)
otherTime
- Some time object.Comparable.compareTo(T)
public String toString()
public Time clone()
clone
in interface IIvyDataObject
clone
in class Object
Copyright © 2024
AXON IVY AG
All Rights Reserved Documentation was generated
on April 28, 2024