public class RubyTime extends RubyObject
RubyObject.Data
RubyBasicObject.Finalizer
Modifier and Type | Field and Description |
---|---|
static BigDecimal |
ONE_BILLION_BD |
static BigDecimal |
ONE_MILLION_BD |
static BigInteger |
ONE_MILLION_BI |
static BigDecimal |
ONE_THOUSAND_BD |
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_ALLOCATOR
ALL_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, varTableStamp
NULL_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() |
static String |
getRubyTimeZoneName(Ruby runtime,
org.joda.time.DateTime dt) |
static String |
getRubyTimeZoneName(String envTZ,
org.joda.time.DateTime dt) |
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)
rb_obj_equal
Will by default use identity equality to compare objects.
|
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() |
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, dig, eqlInternal, equalInternal, equals, hashCode, inspect, puts, specificEval, toString
addFinalizer, 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, initialize, initialize, 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, nonFixnumHashCode, 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, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
public static final String UTC
public static final BigDecimal ONE_MILLION_BD
public static final BigDecimal ONE_BILLION_BD
public static final BigInteger ONE_MILLION_BI
public static final BigDecimal ONE_THOUSAND_BD
public ClassIndex getNativeClassIndex()
RubyObject
getNativeClassIndex
in interface CoreObjectType
getNativeClassIndex
in class RubyObject
ClassIndex
public 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()
RubyBasicObject
getJavaClass
in interface IRubyObject
getJavaClass
in class RubyBasicObject
public IRubyObject initialize_copy(IRubyObject original)
RubyBasicObject
initialize_copy
in class RubyBasicObject
public 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)
RubyBasicObject
op_equal
in interface IRubyObject
op_equal
in class RubyBasicObject
public 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)
RubyObject
op_eqq
in interface IRubyObject
op_eqq
in class RubyObject
public IRubyObject op_cmp(ThreadContext context, IRubyObject other)
op_cmp
in class RubyBasicObject
public IRubyObject eql_p(IRubyObject other)
RubyBasicObject
eql_p
in class RubyBasicObject
public RubyString asctime()
public IRubyObject to_s()
RubyBasicObject
to_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 RubyBasicObject
public IRubyObject to_s19()
public RubyArray to_a()
RubyBasicObject
Object
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 RubyBasicObject
public 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 getRubyTimeZoneName(Ruby runtime, org.joda.time.DateTime dt)
public static String getRubyTimeZoneName(String envTZ, org.joda.time.DateTime dt)
public void setDateTime(org.joda.time.DateTime dt)
public org.joda.time.DateTime getDateTime()
public Date getJavaDate()
public RubyFixnum hash()
RubyBasicObject
hash
in class RubyBasicObject
public 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)
IRubyObject
toJava
in interface IRubyObject
toJava
in class RubyBasicObject
target
- 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-2016 JRuby. All Rights Reserved.