|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyTime
public class RubyTime
The Time class.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jruby.RubyObject |
---|
RubyObject.Data, RubyObject.ObjectMethods |
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject |
---|
RubyBasicObject.BasicObjectMethods, RubyBasicObject.Finalizer |
Field Summary | |
---|---|
static java.lang.String |
UTC
|
Fields inherited from class org.jruby.RubyObject |
---|
OBJECT_ALLOCATOR |
Fields inherited from class org.jruby.RubyBasicObject |
---|
ALL_F, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F |
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject |
---|
NULL_ARRAY |
Constructor Summary | |
---|---|
RubyTime(Ruby runtime,
RubyClass rubyClass)
|
|
RubyTime(Ruby runtime,
RubyClass rubyClass,
org.joda.time.DateTime dt)
|
Method Summary | |
---|---|
RubyString |
asctime()
|
static IRubyObject |
at(ThreadContext context,
IRubyObject recv,
IRubyObject arg)
|
static IRubyObject |
at(ThreadContext context,
IRubyObject recv,
IRubyObject arg1,
IRubyObject arg2)
|
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()
|
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()
|
static org.joda.time.DateTimeZone |
getLocalTimeZone(Ruby runtime)
|
protected long |
getTimeInMillis()
|
static org.joda.time.DateTimeZone |
getTimeZone(Ruby runtime,
java.lang.String zone)
|
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()
|
RubyInteger |
mday()
|
RubyObject |
mdump(IRubyObject[] args)
|
long |
microseconds()
|
RubyInteger |
min()
|
RubyInteger |
month()
|
static RubyTime |
new_local(IRubyObject recv,
IRubyObject[] args)
|
static RubyTime |
new_utc(IRubyObject recv,
IRubyObject[] args)
|
static IRubyObject |
newInstance(ThreadContext context,
IRubyObject recv)
|
static IRubyObject |
newInstance(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block)
Deprecated. Use newInstance(ThreadContext, IRubyObject) |
static RubyTime |
newTime(Ruby runtime,
org.joda.time.DateTime dt)
|
static RubyTime |
newTime(Ruby runtime,
org.joda.time.DateTime dt,
long usec)
|
static RubyTime |
newTime(Ruby runtime,
long milliseconds)
|
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_plus(IRubyObject other)
|
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 |
setUSec(long usec)
|
RubyString |
strftime(IRubyObject format)
|
RubyTime |
succ()
|
static IRubyObject |
times(ThreadContext context,
IRubyObject recv)
|
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_s()
rb_any_to_s call-seq: obj.to_s => string Returns a string representing obj. |
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()
|
RubyString |
zone()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String UTC
Constructor Detail |
---|
public RubyTime(Ruby runtime, RubyClass rubyClass)
public RubyTime(Ruby runtime, RubyClass rubyClass, org.joda.time.DateTime dt)
Method Detail |
---|
public static org.joda.time.DateTimeZone getLocalTimeZone(Ruby runtime)
public static org.joda.time.DateTimeZone getTimeZone(Ruby runtime, java.lang.String zone)
public static RubyClass createTimeClass(Ruby runtime)
public void setUSec(long usec)
public long getUSec()
public void updateCal(org.joda.time.DateTime dt)
protected long getTimeInMillis()
public static RubyTime newTime(Ruby runtime, long milliseconds)
public static RubyTime newTime(Ruby runtime, org.joda.time.DateTime dt)
public static RubyTime newTime(Ruby runtime, org.joda.time.DateTime dt, long usec)
public java.lang.Class<?> getJavaClass()
RubyBasicObject
getJavaClass
in interface IRubyObject
getJavaClass
in class RubyBasicObject
public IRubyObject initialize_copy(IRubyObject original)
RubyObject
initialize_copy
in class RubyObject
public RubyTime succ()
public RubyTime gmtime()
public RubyTime localtime()
public RubyBoolean gmt()
public RubyTime getgm()
public RubyTime getlocal()
public RubyString strftime(IRubyObject format)
public IRubyObject op_equal(ThreadContext context, IRubyObject other)
RubyObject
op_equal
in interface IRubyObject
op_equal
in class RubyObject
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_minus(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)
public IRubyObject eql_p(IRubyObject other)
RubyObject
eql_p
in class RubyObject
public RubyString asctime()
public IRubyObject to_s()
RubyObject
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 RubyObject
public RubyArray to_a()
RubyObject
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 RubyObject
public RubyFloat to_f()
public RubyInteger to_i()
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 RubyInteger gmt_offset()
public RubyBoolean isdst()
public RubyString zone()
public void setDateTime(org.joda.time.DateTime dt)
public org.joda.time.DateTime getDateTime()
public java.util.Date getJavaDate()
public RubyFixnum hash()
RubyObject
hash
in class RubyObject
public RubyString dump(IRubyObject[] args, Block unusedBlock)
public RubyObject mdump(IRubyObject[] args)
public IRubyObject initialize(Block block)
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 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)
IRubyObject
toJava
in interface IRubyObject
toJava
in class RubyBasicObject
target
- The target type to which the object should be converted.IRubyObject.toJava
protected static RubyTime s_mload(IRubyObject recv, RubyTime time, IRubyObject from)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |