org.jruby
Class RubyTime

java.lang.Object
  extended byorg.jruby.RubyObject
      extended byorg.jruby.RubyTime
All Implemented Interfaces:
java.lang.Cloneable, IRubyObject

public class RubyTime
extends RubyObject

The Time class.

Author:
chadfowler, jpetersen

Nested Class Summary
 
Nested classes inherited from class org.jruby.RubyObject
RubyObject.Finalizer
 
Field Summary
static java.lang.String UTC
           
 
Fields inherited from class org.jruby.RubyObject
instanceVariables, isTrue, metaClass, NEVER, OBJECT_ALLOCATOR
 
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY
 
Constructor Summary
RubyTime(Ruby runtime, RubyClass rubyClass)
           
RubyTime(Ruby runtime, RubyClass rubyClass, java.util.Calendar cal)
           
 
Method Summary
 RubyString asctime()
           
static RubyClass createTimeClass(Ruby runtime)
           
 RubyString dump(IRubyObject[] args, Block unusedBlock)
           
 IRubyObject eql_p(IRubyObject other)
           
 RubyTime getgm()
           
 java.util.Date getJavaDate()
           
 RubyTime getlocal()
           
static java.util.TimeZone getLocalTimeZone(Ruby runtime)
           
protected  long getTimeInMillis()
           
protected  long getUSec()
           
 RubyInteger gmt_offset()
           
 RubyBoolean gmt()
           
 RubyTime gmtime()
           
 RubyFixnum hash()
           
 RubyInteger hour()
           
 IRubyObject initialize_copy(IRubyObject original)
          rb_obj_init_copy
 IRubyObject initialize(IRubyObject[] args, Block block)
           
 RubyBoolean isdst()
           
 RubyTime localtime()
           
 RubyInteger mday()
           
 RubyObject mdump(IRubyObject[] args)
           
 long microseconds()
           
 RubyInteger min()
           
 RubyInteger month()
           
static IRubyObject new_at(IRubyObject recv, IRubyObject[] args)
           
static RubyTime new_local(IRubyObject recv, IRubyObject[] args)
           
static RubyTime new_utc(IRubyObject recv, IRubyObject[] args)
           
static RubyTime newTime(Ruby runtime, java.util.Calendar cal)
           
static RubyTime newTime(Ruby runtime, long milliseconds)
           
 IRubyObject op_cmp(IRubyObject other)
           
 IRubyObject op_ge(IRubyObject other)
           
 IRubyObject op_gt(IRubyObject other)
           
 IRubyObject op_le(IRubyObject other)
           
 IRubyObject op_lt(IRubyObject other)
           
 IRubyObject op_minus(IRubyObject other)
           
 IRubyObject op_plus(IRubyObject other)
           
static RubyTime s_load(IRubyObject recv, IRubyObject from, Block block)
           
protected static RubyTime s_mload(IRubyObject recv, RubyTime time, IRubyObject from)
           
static IRubyObject s_new(IRubyObject recv, IRubyObject[] args, Block block)
           
 IRubyObject same2(IRubyObject other)
           
 RubyInteger sec()
           
 void setJavaCalendar(java.util.Calendar cal)
           
 void setMicroseconds(long mic)
           
 void setUSec(long usec)
           
 RubyString strftime(IRubyObject format)
           
 RubyTime succ()
           
 RubyArray to_a()
           
 RubyFloat to_f()
           
 RubyInteger to_i()
           
 IRubyObject to_s()
           
 void updateCal(java.util.Calendar calendar)
           
 RubyInteger usec()
           
 RubyInteger wday()
           
 RubyInteger yday()
           
 RubyInteger year()
           
 RubyString zone()
           
 
Methods inherited from class org.jruby.RubyObject
addFinalizer, anyToString, asString, asSymbol, attachToObjectSpace, callInit, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethodMissingIfNecessary, callSuper, checkArrayType, checkFrozen, checkStringType, compilerCallMethod, compilerCallMethodWithIndex, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToString, convertToType, convertToType, convertToType, convertToTypeWithCheck, createObjectClass, dataGetStruct, dataWrapStruct, display, doClone, dup, eql, eqlInternal, equal, equalInternal, equals, evalSimple, evalUnder, evalWithBinding, extend, freeze, frozen, getInstanceVariable, getInstanceVariables, getInstanceVariablesSnapshot, getJavaClass, getMetaClass, getNativeTypeIndex, getRuntime, getSingletonClass, getSingletonClassClone, getType, hashCode, id_deprecated, id, infectBy, inherited, initCopy, inspect, instance_eval, instance_exec, instance_of, instance_variable_get, instance_variable_set, instance_variables, instanceVariableNames, isFalse, isFrozen, isImmediate, isKindOf, isNil, isSingleton, isTaint, isTrue, kind_of, makeMetaClass, match, method, methods, nil_p, obj_equal, private_methods, protected_methods, public_methods, puts, rbClone, remove_instance_variable, removeFinalizers, removeInstanceVariable, respond_to, respondsTo, safeGetInstanceVariables, safeHasInstanceVariables, send, setFrozen, setInstanceVariable, setInstanceVariable, setInstanceVariables, setMetaClass, setTaint, singleton_methods, specificEval, taint, tainted, testFrozen, toString, trueFalseNil, trueFalseNil, type_deprecated, type, untaint
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

UTC

public static final java.lang.String UTC
See Also:
Constant Field Values
Constructor Detail

RubyTime

public RubyTime(Ruby runtime,
                RubyClass rubyClass)

RubyTime

public RubyTime(Ruby runtime,
                RubyClass rubyClass,
                java.util.Calendar cal)
Method Detail

getLocalTimeZone

public static java.util.TimeZone getLocalTimeZone(Ruby runtime)

createTimeClass

public static RubyClass createTimeClass(Ruby runtime)

setUSec

public void setUSec(long usec)

getUSec

protected long getUSec()

updateCal

public void updateCal(java.util.Calendar calendar)

getTimeInMillis

protected long getTimeInMillis()

newTime

public static RubyTime newTime(Ruby runtime,
                               long milliseconds)

newTime

public static RubyTime newTime(Ruby runtime,
                               java.util.Calendar cal)

initialize_copy

public IRubyObject initialize_copy(IRubyObject original)
Description copied from class: RubyObject
rb_obj_init_copy

Overrides:
initialize_copy in class RubyObject

succ

public RubyTime succ()

gmtime

public RubyTime gmtime()

localtime

public RubyTime localtime()

gmt

public RubyBoolean gmt()

getgm

public RubyTime getgm()

getlocal

public RubyTime getlocal()

strftime

public RubyString strftime(IRubyObject format)

op_ge

public IRubyObject op_ge(IRubyObject other)

op_gt

public IRubyObject op_gt(IRubyObject other)

op_le

public IRubyObject op_le(IRubyObject other)

op_lt

public IRubyObject op_lt(IRubyObject other)

op_plus

public IRubyObject op_plus(IRubyObject other)

op_minus

public IRubyObject op_minus(IRubyObject other)

same2

public IRubyObject same2(IRubyObject other)

op_cmp

public IRubyObject op_cmp(IRubyObject other)

eql_p

public IRubyObject eql_p(IRubyObject other)

asctime

public RubyString asctime()

to_s

public IRubyObject to_s()
Overrides:
to_s in class RubyObject

to_a

public RubyArray to_a()

to_f

public RubyFloat to_f()

to_i

public RubyInteger to_i()

usec

public RubyInteger usec()

setMicroseconds

public void setMicroseconds(long mic)

microseconds

public long microseconds()

sec

public RubyInteger sec()

min

public RubyInteger min()

hour

public RubyInteger hour()

mday

public RubyInteger mday()

month

public RubyInteger month()

year

public RubyInteger year()

wday

public RubyInteger wday()

yday

public RubyInteger yday()

gmt_offset

public RubyInteger gmt_offset()

isdst

public RubyBoolean isdst()

zone

public RubyString zone()

setJavaCalendar

public void setJavaCalendar(java.util.Calendar cal)

getJavaDate

public java.util.Date getJavaDate()

hash

public RubyFixnum hash()
Overrides:
hash in class RubyObject

dump

public RubyString dump(IRubyObject[] args,
                       Block unusedBlock)

mdump

public RubyObject mdump(IRubyObject[] args)

initialize

public IRubyObject initialize(IRubyObject[] args,
                              Block block)
Overrides:
initialize in class RubyObject

s_new

public static IRubyObject s_new(IRubyObject recv,
                                IRubyObject[] args,
                                Block block)

new_at

public static IRubyObject new_at(IRubyObject recv,
                                 IRubyObject[] args)

new_local

public static RubyTime new_local(IRubyObject recv,
                                 IRubyObject[] args)

new_utc

public static RubyTime new_utc(IRubyObject recv,
                               IRubyObject[] args)

s_load

public static RubyTime s_load(IRubyObject recv,
                              IRubyObject from,
                              Block block)

s_mload

protected static RubyTime s_mload(IRubyObject recv,
                                  RubyTime time,
                                  IRubyObject from)


Copyright © 2002-2007 JRuby Team. All Rights Reserved.