public class RubyTime extends RubyObject
RubyObject.DataRubyBasicObject.Finalizer| Modifier and Type | Field and Description |
|---|---|
static 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, IS_OVERLAID_F, metaClass, NEVER, NIL_F, REFINED_MODULE_F, STAMP_OFFSET, TAINTED_F, UNDEF, UNTRUST_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, USER9_F, USERA_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) |
static double |
convertTimeInterval(ThreadContext context,
IRubyObject sec) |
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.
|
org.joda.time.DateTime |
getDateTime() |
RubyTime |
getgm() |
Class<?> |
getJavaClass()
Will return the Java interface that most closely can represent
this object, when working through JAva integration
translations.
|
Date |
getJavaDate() |
RubyTime |
getlocal() |
RubyTime |
getlocal19(ThreadContext context,
IRubyObject[] args) |
static org.joda.time.DateTimeZone |
getLocalTimeZone(Ruby runtime) |
ClassIndex |
getNativeClassIndex()
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) |
static org.joda.time.DateTimeZone |
getTimeZoneFromString(Ruby runtime,
String zone) |
static org.joda.time.DateTimeZone |
getTimeZoneFromTZString(Ruby runtime,
String zone) |
static org.joda.time.DateTimeZone |
getTimeZoneFromUtcOffset(Ruby runtime,
IRubyObject utcOffset) |
static org.joda.time.DateTimeZone |
getTimeZoneWithOffset(Ruby runtime,
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) |
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() |
IRubyObject |
op_cmp(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) |
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) |
void |
setMicroseconds(long mic) |
void |
setNSec(long nsec) |
void |
setUSec(long usec) |
RubyString |
strftime(IRubyObject format) |
IRubyObject |
subsec() |
RubyTime |
succ() |
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() |
Object |
toJava(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() |
static String |
zoneHelper(String envTZ,
org.joda.time.DateTime dt,
boolean isTzRelative) |
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, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id, 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, isSpecialConst, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method_missing19, method, method19, methods, methods, methods19, nil_p, OBJ_INIT_COPY, objInitCopy, 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, rbInspect, 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, 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 String UTC
public ClassIndex getNativeClassIndex()
RubyObjectgetNativeClassIndex in interface CoreObjectTypegetNativeClassIndex in class RubyObjectClassIndexpublic static org.joda.time.DateTimeZone getLocalTimeZone(Ruby runtime)
public static org.joda.time.DateTimeZone getTimeZoneFromTZString(Ruby runtime, String zone)
public static org.joda.time.DateTimeZone getTimeZoneFromString(Ruby runtime, String zone)
public static org.joda.time.DateTimeZone getTimeZoneFromUtcOffset(Ruby runtime, IRubyObject utcOffset)
public static org.joda.time.DateTimeZone getTimeZone(Ruby runtime, long seconds)
public static org.joda.time.DateTimeZone getTimeZoneWithOffset(Ruby runtime, 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 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)
public IRubyObject op_plus(IRubyObject other)
public IRubyObject op_plus19(ThreadContext context, IRubyObject other)
public IRubyObject op_minus(IRubyObject other)
public IRubyObject op_minus19(ThreadContext context, 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 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()
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 static String zoneHelper(String envTZ, org.joda.time.DateTime dt, boolean isTzRelative)
public void setDateTime(org.joda.time.DateTime dt)
public org.joda.time.DateTime getDateTime()
public 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 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 Object toJava(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)
Copyright © 2001-2015 JRuby. All Rights Reserved.