public class SFTime extends SFInstant implements Comparable<SFTime>
| Modifier and Type | Field and Description |
|---|---|
static SFTime |
MAX_VALID_VALUE |
static SFTime |
MIN_VALID_VALUE |
DAY_OF_WEEK_ISO, GMT, POWERS_OF_TEN, WEEK_ISO, YEAR_OF_WEEK, YEAR_OF_WEEK_ISO| Modifier and Type | Method and Description |
|---|---|
SFTime |
addComponent(int component,
long increment)
Create an SFTime by adding hours, minutes, seconds, or milliseconds.
|
SFTime |
adjustScale(int scale)
Create an SFTime with an adjusted scale.
|
int |
compareTo(SFTime other)
Compares with other SFTime
|
boolean |
equals(Object other) |
int |
extract(int field,
Integer optWeekStart,
Integer optWoyPolicy) |
static SFTime |
fromFractionalSeconds(long value,
int scale)
Constructs an SFTime from fractional seconds at a particular scale.
|
static SFTime |
fromNanoseconds(long nanos)
Constructs an SFTime given nanoseconds since midnight.
|
static SFTime |
fromTimestamp(SFTimestamp ts)
Constructs an SFTime from an SFTimestamp.
|
long |
getFractionalSeconds(int scale)
Returns fractional seconds since midnight at the given scale, truncated
from the internal nanosecond representation.
|
long |
getNanoseconds()
Returns nanoseconds since midnight.
|
int |
getNanosecondsWithinSecond()
Returns nanoseconds since the last whole-number second.
|
int |
hashCode() |
String |
toSecondsString(int decimalPlaces)
Constructs a string containing the number of seconds since midnight with
the given number of decimal places.
|
String |
toString() |
String |
toUTCString()
Constructs a string that can be safely passed to XP.
|
public static final SFTime MIN_VALID_VALUE
public static final SFTime MAX_VALID_VALUE
public static SFTime fromNanoseconds(long nanos)
nanos - nanosecondspublic static SFTime fromFractionalSeconds(long value, int scale)
value - Fractional seconds since midnight.scale - The scale for interpreting value. A scale of 0 means seconds, and
a scale of 9 means nanoseconds.public static SFTime fromTimestamp(SFTimestamp ts)
ts - SFTimestamppublic long getNanoseconds()
public int getNanosecondsWithinSecond()
public long getFractionalSeconds(int scale)
scale - scalefromFractionalSeconds(long, int)public SFTime addComponent(int component, long increment)
component - The time component from the Calendar class.increment - Number of hours/minutes/etc. to add.public SFTime adjustScale(int scale)
scale - The desired scale.public String toUTCString()
public String toSecondsString(int decimalPlaces)
decimalPlaces - decimal placespublic int compareTo(SFTime other)
compareTo in interface Comparable<SFTime>other - target SFTimeCopyright © 2020. All rights reserved.