public class RubyTime extends RubyObject
RubyObject.DataRubyBasicObject.Finalizer| Modifier and Type | Field and Description |
|---|---|
private static int |
ARG_SIZE |
private org.joda.time.DateTime |
dt |
private boolean |
isTzRelative |
private static java.util.Map<java.lang.String,java.lang.String> |
LONG_TZNAME |
private static java.lang.String[] |
MONTHS |
private static java.util.Map<java.lang.String,java.lang.Integer> |
MONTHS_MAP |
private static java.util.Map<java.lang.String,java.lang.String> |
NON_JVM_TZNAME |
private long |
nsec |
private static org.joda.time.format.DateTimeFormatter |
ONE_DAY_CTIME_FORMATTER |
private static java.util.Map<java.lang.String,java.lang.String> |
SHORT_DL_TZNAME |
private static java.util.Map<java.lang.String,java.lang.String> |
SHORT_STD_TZNAME |
private static ObjectAllocator |
TIME_ALLOCATOR |
private static java.util.regex.Pattern |
TIME_OFFSET_PATTERN |
private static org.joda.time.format.DateTimeFormatter |
TO_S_FORMATTER |
private static org.joda.time.format.DateTimeFormatter |
TO_S_FORMATTER_19 |
private static org.joda.time.format.DateTimeFormatter |
TO_S_UTC_FORMATTER |
private static org.joda.time.format.DateTimeFormatter |
TO_S_UTC_FORMATTER_19 |
private static org.joda.time.format.DateTimeFormatter |
TWO_DAY_CTIME_FORMATTER |
private static java.util.regex.Pattern |
TZ_PATTERN |
private static org.jruby.util.ByteList |
TZ_STRING |
static java.lang.String |
UTC |
FIELD_ALLOCATED_CLASSES, FIELD_ALLOCATORS, IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, OBJECT_VAR0_ALLOCATOR, OBJECT_VAR1_ALLOCATOR, OBJECT_VAR2_ALLOCATOR, OBJECT_VAR3_ALLOCATOR, OBJECT_VAR4_ALLOCATOR, OBJECT_VAR5_ALLOCATOR, OBJECT_VAR6_ALLOCATOR, OBJECT_VAR7_ALLOCATOR, OBJECT_VAR8_ALLOCATOR, OBJECT_VAR9_ALLOCATOR, REIFYING_OBJECT_ALLOCATORALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, STAMP_OFFSET, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, VAR_TABLE_OFFSET, varTable, varTableStampNULL_ARRAY| Constructor and Description |
|---|
RubyTime(Ruby runtime,
RubyClass rubyClass) |
RubyTime(Ruby runtime,
RubyClass rubyClass,
org.joda.time.DateTime dt) |
| Modifier and Type | Method and Description |
|---|---|
RubyString |
asctime() |
static IRubyObject |
at(ThreadContext context,
IRubyObject recv,
IRubyObject arg) |
static IRubyObject |
at(ThreadContext context,
IRubyObject recv,
IRubyObject arg1,
IRubyObject arg2) |
private void |
checkOpCoercion(ThreadContext context,
IRubyObject other) |
private int |
cmp(RubyTime other) |
static double |
convertTimeInterval(ThreadContext context,
IRubyObject sec) |
private static RubyTime |
createTime(IRubyObject recv,
IRubyObject[] args,
boolean gmt,
boolean utcOffset) |
static RubyClass |
createTimeClass(Ruby runtime) |
RubyString |
dump(IRubyObject[] args,
Block unusedBlock) |
IRubyObject |
eql_p(IRubyObject other)
rb_obj_equal
Just like "==" and "equal?", "eql?" will use identity equality for Object.
|
private static void |
exactTypeError(Ruby runtime,
IRubyObject received) |
org.joda.time.DateTime |
getDateTime() |
private static IRubyObject |
getEnvTimeZone(Ruby runtime) |
RubyTime |
getgm() |
java.lang.Class<?> |
getJavaClass()
Will return the Java interface that most closely can represent
this object, when working through JAva integration
translations.
|
java.util.Date |
getJavaDate() |
RubyTime |
getlocal() |
RubyTime |
getlocal19(ThreadContext context,
IRubyObject[] args) |
static org.joda.time.DateTimeZone |
getLocalTimeZone(Ruby runtime) |
int |
getNativeTypeIndex()
This is overridden in the other concrete Java builtins to provide a fast way
to determine what type they are.
|
long |
getNSec() |
protected long |
getTimeInMillis() |
static org.joda.time.DateTimeZone |
getTimeZone(Ruby runtime,
long seconds) |
private static org.joda.time.DateTimeZone |
getTimeZoneFromHHMM(Ruby runtime,
java.lang.String name,
boolean positive,
java.lang.String hours,
java.lang.String minutes) |
static org.joda.time.DateTimeZone |
getTimeZoneFromString(Ruby runtime,
java.lang.String zone) |
private static org.joda.time.DateTimeZone |
getTimeZoneFromTZString(Ruby runtime,
java.lang.String zone) |
static org.joda.time.DateTimeZone |
getTimeZoneFromUtcOffset(Ruby runtime,
IRubyObject utcOffset) |
static org.joda.time.DateTimeZone |
getTimeZoneWithOffset(Ruby runtime,
java.lang.String zoneName,
int offset) |
long |
getUSec() |
RubyInteger |
gmt_offset() |
RubyBoolean |
gmt() |
RubyTime |
gmtime() |
RubyFixnum |
hash()
rb_obj_id
Will return the hash code of this object.
|
RubyInteger |
hour() |
IRubyObject |
initialize_copy(IRubyObject original)
rb_obj_init_copy
Initializes this object as a copy of the original, that is the
parameter to this object.
|
IRubyObject |
initialize(Block block) |
private IRubyObject |
inspectCommon(org.joda.time.format.DateTimeFormatter formatter,
org.joda.time.format.DateTimeFormatter utcFormatter) |
RubyBoolean |
isdst() |
static RubyTime |
load(IRubyObject recv,
IRubyObject from,
Block block) |
RubyTime |
localtime() |
RubyTime |
localtime19(ThreadContext context,
IRubyObject[] args) |
RubyInteger |
mday() |
RubyObject |
mdump() |
long |
microseconds() |
RubyInteger |
min() |
RubyInteger |
month() |
static RubyTime |
new_local(IRubyObject recv,
IRubyObject[] args) |
static RubyTime |
new_utc(IRubyObject recv,
IRubyObject[] args) |
static IRubyObject |
new19(ThreadContext context,
IRubyObject recv,
IRubyObject[] args) |
static IRubyObject |
newInstance(ThreadContext context,
IRubyObject recv) |
static IRubyObject |
newInstance(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block)
Deprecated.
|
static RubyTime |
newTime(Ruby runtime,
org.joda.time.DateTime dt) |
static RubyTime |
newTime(Ruby runtime,
org.joda.time.DateTime dt,
long nsec) |
static RubyTime |
newTime(Ruby runtime,
long milliseconds) |
RubyInteger |
nsec() |
private static IRubyObject |
numExact(Ruby runtime,
IRubyObject v) |
IRubyObject |
op_cmp(ThreadContext context,
IRubyObject other) |
IRubyObject |
op_cmp19(ThreadContext context,
IRubyObject other) |
IRubyObject |
op_eqq(ThreadContext context,
IRubyObject other)
rb_equal
The Ruby "===" method is used by default in case/when
statements.
|
IRubyObject |
op_equal(ThreadContext context,
IRubyObject other) |
IRubyObject |
op_ge(ThreadContext context,
IRubyObject other) |
IRubyObject |
op_gt(ThreadContext context,
IRubyObject other) |
IRubyObject |
op_le(ThreadContext context,
IRubyObject other) |
IRubyObject |
op_lt(ThreadContext context,
IRubyObject other) |
IRubyObject |
op_minus(IRubyObject other) |
IRubyObject |
op_minus19(ThreadContext context,
IRubyObject other) |
IRubyObject |
op_plus(IRubyObject other) |
IRubyObject |
op_plus19(ThreadContext context,
IRubyObject other) |
private IRubyObject |
opMinus(RubyTime other) |
private IRubyObject |
opMinusCommon(IRubyObject other) |
private IRubyObject |
opPlusMicros(long adjustMicros) |
private IRubyObject |
opPlusNanos(long adjustNanos) |
private static org.joda.time.DateTimeZone |
parseTZString(Ruby runtime,
java.lang.String zone) |
private static org.joda.time.DateTimeZone |
parseZoneString(Ruby runtime,
java.lang.String zone) |
RubyTime |
round(ThreadContext context,
IRubyObject[] args) |
protected static RubyTime |
s_mload(IRubyObject recv,
RubyTime time,
IRubyObject from) |
static IRubyObject |
s_new(IRubyObject recv,
IRubyObject[] args,
Block block) |
RubyInteger |
sec() |
void |
setDateTime(org.joda.time.DateTime dt) |
private void |
setIsTzRelative(boolean tzRelative) |
void |
setMicroseconds(long mic) |
void |
setNSec(long nsec) |
void |
setUSec(long usec) |
RubyString |
strftime(IRubyObject format) |
IRubyObject |
subsec() |
RubyTime |
succ() |
static IRubyObject |
times(ThreadContext context,
IRubyObject recv) |
private static org.joda.time.DateTimeZone |
timeZoneWithOffset(java.lang.String zoneName,
int offset) |
RubyArray |
to_a()
rb_any_to_a
call-seq:
obj.to_a -> anArray
Returns an array representation of obj.
|
RubyFloat |
to_f() |
RubyInteger |
to_i() |
IRubyObject |
to_r(ThreadContext context) |
IRubyObject |
to_s()
rb_any_to_s
call-seq:
obj.to_s => string
Returns a string representing obj.
|
IRubyObject |
to_s19() |
java.lang.Object |
toJava(java.lang.Class target)
Convert the object to the specified Java class, if possible.
|
void |
updateCal(org.joda.time.DateTime dt) |
RubyInteger |
usec() |
RubyInteger |
wday() |
RubyInteger |
yday() |
RubyInteger |
year() |
IRubyObject |
zone() |
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, equals, hashCode, initialize, initialize, inspect, puts, specificEval, toStringaddFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, display, dup, ensureInstanceVariablesSettable, eql, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getMetaClass, getNativeHandle, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id_deprecated, id, infectBy, infectBy, infectBy, initialize19, inspect, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval19, instance_eval19, instance_eval19, instance_eval19, instance_exec, instance_exec19, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, instance_variables19, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method_missing19, method, method19, methods, methods, methods19, nil_p, op_equal_19, op_match, op_match19, op_not_equal, op_not_match, op_not, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, recacheBuiltinMethods, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respond_to_p19, respond_to_p19, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, send19, send19, send19, send19, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method_added19, singleton_method_removed19, singleton_method_undefined19, singleton_methods, singleton_methods19, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnderpublic static final java.lang.String UTC
private org.joda.time.DateTime dt
private long nsec
private static final org.joda.time.format.DateTimeFormatter ONE_DAY_CTIME_FORMATTER
private static final org.joda.time.format.DateTimeFormatter TWO_DAY_CTIME_FORMATTER
private static final org.joda.time.format.DateTimeFormatter TO_S_FORMATTER
private static final org.joda.time.format.DateTimeFormatter TO_S_UTC_FORMATTER
private static final org.joda.time.format.DateTimeFormatter TO_S_FORMATTER_19
private static final org.joda.time.format.DateTimeFormatter TO_S_UTC_FORMATTER_19
private static final java.util.regex.Pattern TZ_PATTERN
private static final java.util.regex.Pattern TIME_OFFSET_PATTERN
private static final org.jruby.util.ByteList TZ_STRING
private boolean isTzRelative
private static final java.util.Map<java.lang.String,java.lang.String> LONG_TZNAME
private static final java.util.Map<java.lang.String,java.lang.String> NON_JVM_TZNAME
private static final java.util.Map<java.lang.String,java.lang.String> SHORT_STD_TZNAME
private static final java.util.Map<java.lang.String,java.lang.String> SHORT_DL_TZNAME
private static ObjectAllocator TIME_ALLOCATOR
private static final java.lang.String[] MONTHS
private static final java.util.Map<java.lang.String,java.lang.Integer> MONTHS_MAP
private static final int ARG_SIZE
private void setIsTzRelative(boolean tzRelative)
public int getNativeTypeIndex()
RubyObjectgetNativeTypeIndex in interface CoreObjectTypegetNativeTypeIndex in class RubyObjectClassIndexprivate static IRubyObject getEnvTimeZone(Ruby runtime)
public static org.joda.time.DateTimeZone getLocalTimeZone(Ruby runtime)
private static org.joda.time.DateTimeZone getTimeZoneFromTZString(Ruby runtime, java.lang.String zone)
private static org.joda.time.DateTimeZone parseTZString(Ruby runtime, java.lang.String zone)
public static org.joda.time.DateTimeZone getTimeZoneFromString(Ruby runtime, java.lang.String zone)
private static org.joda.time.DateTimeZone parseZoneString(Ruby runtime, java.lang.String zone)
public static org.joda.time.DateTimeZone getTimeZoneFromUtcOffset(Ruby runtime, IRubyObject utcOffset)
private static IRubyObject numExact(Ruby runtime, IRubyObject v)
private static void exactTypeError(Ruby runtime, IRubyObject received)
private static org.joda.time.DateTimeZone getTimeZoneFromHHMM(Ruby runtime, java.lang.String name, boolean positive, java.lang.String hours, java.lang.String minutes)
public static org.joda.time.DateTimeZone getTimeZone(Ruby runtime, long seconds)
public static org.joda.time.DateTimeZone getTimeZoneWithOffset(Ruby runtime, java.lang.String zoneName, int offset)
private static org.joda.time.DateTimeZone timeZoneWithOffset(java.lang.String zoneName,
int offset)
public void setNSec(long nsec)
public long getNSec()
public void setUSec(long usec)
public long getUSec()
public void updateCal(org.joda.time.DateTime dt)
protected long getTimeInMillis()
public java.lang.Class<?> getJavaClass()
RubyBasicObjectgetJavaClass in interface IRubyObjectgetJavaClass in class RubyBasicObjectpublic IRubyObject initialize_copy(IRubyObject original)
RubyBasicObjectinitialize_copy in class RubyBasicObjectpublic RubyTime succ()
public RubyTime gmtime()
public RubyTime localtime()
public RubyTime localtime19(ThreadContext context, IRubyObject[] args)
public RubyBoolean gmt()
public RubyTime getgm()
public RubyTime getlocal()
public RubyTime getlocal19(ThreadContext context, IRubyObject[] args)
public RubyString strftime(IRubyObject format)
public IRubyObject op_equal(ThreadContext context, IRubyObject other)
op_equal in interface IRubyObjectop_equal in class RubyBasicObjectpublic IRubyObject op_ge(ThreadContext context, IRubyObject other)
public IRubyObject op_gt(ThreadContext context, IRubyObject other)
public IRubyObject op_le(ThreadContext context, IRubyObject other)
public IRubyObject op_lt(ThreadContext context, IRubyObject other)
private int cmp(RubyTime other)
public IRubyObject op_plus(IRubyObject other)
public IRubyObject op_plus19(ThreadContext context, IRubyObject other)
private IRubyObject opPlusMicros(long adjustMicros)
private IRubyObject opPlusNanos(long adjustNanos)
private void checkOpCoercion(ThreadContext context, IRubyObject other)
private IRubyObject opMinus(RubyTime other)
public IRubyObject op_minus(IRubyObject other)
public IRubyObject op_minus19(ThreadContext context, IRubyObject other)
private IRubyObject opMinusCommon(IRubyObject other)
public IRubyObject op_eqq(ThreadContext context, IRubyObject other)
RubyObjectop_eqq in interface IRubyObjectop_eqq in class RubyObjectpublic IRubyObject op_cmp(ThreadContext context, IRubyObject other)
op_cmp in class RubyBasicObjectpublic IRubyObject op_cmp19(ThreadContext context, IRubyObject other)
public IRubyObject eql_p(IRubyObject other)
RubyBasicObjecteql_p in class RubyBasicObjectpublic RubyString asctime()
public IRubyObject to_s()
RubyBasicObjectto_s prints the object's class and an encoding of the
object id. As a special case, the top-level object that is the
initial execution context of Ruby programs returns ``main.''to_s in class RubyBasicObjectpublic IRubyObject to_s19()
private IRubyObject inspectCommon(org.joda.time.format.DateTimeFormatter formatter, org.joda.time.format.DateTimeFormatter utcFormatter)
public RubyArray to_a()
RubyBasicObjectObject and others that don't explicitly override the
method, the return value is an array containing self.
However, this latter behavior will soon be obsolete.
self.to_a #=> -:1: warning: default `to_a' will be obsolete
"hello".to_a #=> ["hello"]
Time.new.to_a #=> [39, 54, 8, 9, 4, 2003, 3, 99, true, "CDT"]
The default to_a method is deprecated.to_a in class RubyBasicObjectpublic RubyFloat to_f()
public RubyInteger to_i()
public RubyInteger nsec()
public IRubyObject to_r(ThreadContext context)
public RubyInteger usec()
public void setMicroseconds(long mic)
public long microseconds()
public RubyInteger sec()
public RubyInteger min()
public RubyInteger hour()
public RubyInteger mday()
public RubyInteger month()
public RubyInteger year()
public RubyInteger wday()
public RubyInteger yday()
public IRubyObject subsec()
public RubyInteger gmt_offset()
public RubyBoolean isdst()
public IRubyObject zone()
public void setDateTime(org.joda.time.DateTime dt)
public org.joda.time.DateTime getDateTime()
public java.util.Date getJavaDate()
public RubyFixnum hash()
RubyBasicObjecthash in class RubyBasicObjectpublic RubyString dump(IRubyObject[] args, Block unusedBlock)
public RubyObject mdump()
public IRubyObject initialize(Block block)
public RubyTime round(ThreadContext context, IRubyObject[] args)
public static IRubyObject s_new(IRubyObject recv, IRubyObject[] args, Block block)
@Deprecated public static IRubyObject newInstance(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
newInstance(ThreadContext, IRubyObject)public static IRubyObject times(ThreadContext context, IRubyObject recv)
public static IRubyObject newInstance(ThreadContext context, IRubyObject recv)
public static IRubyObject at(ThreadContext context, IRubyObject recv, IRubyObject arg)
public static IRubyObject at(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2)
public static RubyTime new_local(IRubyObject recv, IRubyObject[] args)
public static IRubyObject new19(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public static RubyTime new_utc(IRubyObject recv, IRubyObject[] args)
public static RubyTime load(IRubyObject recv, IRubyObject from, Block block)
public java.lang.Object toJava(java.lang.Class target)
IRubyObjecttoJava in interface IRubyObjecttoJava in class RubyBasicObjecttarget - The target type to which the object should be converted.IRubyObject.toJava(java.lang.Class)public static double convertTimeInterval(ThreadContext context, IRubyObject sec)
protected static RubyTime s_mload(IRubyObject recv, RubyTime time, IRubyObject from)
private static RubyTime createTime(IRubyObject recv, IRubyObject[] args, boolean gmt, boolean utcOffset)