public class PointInTime extends TimeBase implements java.lang.Comparable<PointInTime>
Can be created by adding a Duration
to another PointInTime
.
For the generation of new PointInTime
objects, double values are
parsed to the internal representation using long values. The method
Math.round(double)
is used to get the best fitting long value.
TimeBase.InvalidTimeBaseException
Modifier and Type | Field and Description |
---|---|
static PointInTime |
MAX |
static PointInTime |
ZERO |
EXPORT_UNIT, EXPORT_VALUE
CREATE_INSTANCE_METHOD_NAME
Modifier | Constructor and Description |
---|---|
protected |
PointInTime(long value) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PointInTime other) |
static PointInTime |
createInstance(SimNode ownNode,
Parameters pars) |
static PointInTime |
from(double value,
TimeUnits unit) |
static PointInTime |
fromDays(double days) |
static PointInTime |
fromHours(double hours) |
static PointInTime |
fromMicroSeconds(double microSeconds) |
static PointInTime |
fromMilliSeconds(double milliSeconds) |
static PointInTime |
fromMinutes(double minutes) |
static PointInTime |
fromNanoSeconds(double nanoSeconds) |
static PointInTime |
fromPicoSeconds(double picoSeconds) |
static PointInTime |
fromSeconds(double seconds)
create a new time object from the given value (SI-unit)
|
static PointInTime |
importBatch(ResultReader reader,
java.lang.String name) |
boolean |
isAfter(PointInTime other)
Compare two Time objects
|
boolean |
isAfterOrEqual(PointInTime other) |
boolean |
isBefore(PointInTime other) |
boolean |
isBeforeOrEqual(PointInTime other) |
PointInTime |
plus(Duration duration) |
PointInTime |
selectEarliest(PointInTime other)
Return the earlier of two points in time
|
PointInTime |
selectLatest(PointInTime other)
Return the later of two points in time
|
Duration |
until(PointInTime other) |
changeTimeBase, changeTimeBase, equals, exportBatch, getTimeUnit, getValue, hashCode, internalToSeconds, secondsToInternal, toDays, toHours, toMicroSeconds, toMilliSeconds, toMinutes, toNanoSeconds, toPicoSeconds, toSeconds, toString, toString, toString
public static PointInTime ZERO
public static PointInTime MAX
public static PointInTime createInstance(SimNode ownNode, Parameters pars)
public static PointInTime fromDays(double days)
public static PointInTime fromHours(double hours)
public static PointInTime fromMinutes(double minutes)
public static PointInTime fromSeconds(double seconds)
public static PointInTime fromMilliSeconds(double milliSeconds)
public static PointInTime fromMicroSeconds(double microSeconds)
public static PointInTime fromNanoSeconds(double nanoSeconds)
public static PointInTime fromPicoSeconds(double picoSeconds)
public static PointInTime from(double value, TimeUnits unit)
public static PointInTime importBatch(ResultReader reader, java.lang.String name) throws ImportException
ImportException
public Duration until(PointInTime other)
public PointInTime plus(Duration duration)
public int compareTo(PointInTime other)
compareTo
in interface java.lang.Comparable<PointInTime>
public boolean isAfter(PointInTime other)
other
- the Time to compare with the current objectpublic boolean isAfterOrEqual(PointInTime other)
public boolean isBefore(PointInTime other)
public boolean isBeforeOrEqual(PointInTime other)
public PointInTime selectLatest(PointInTime other)
other
- the other valuepublic PointInTime selectEarliest(PointInTime other)
other
- the other value