org.jruby
Class RubyStruct

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

public class RubyStruct
extends RubyObject

Author:
jpetersen

Nested Class Summary
 
Nested classes inherited from class org.jruby.RubyObject
RubyObject.Finalizer
 
Field Summary
 
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
RubyStruct(Ruby runtime, RubyClass rubyClass)
          Constructor for RubyStruct.
 
Method Summary
 IRubyObject aref(IRubyObject key)
           
 IRubyObject aset(IRubyObject key, IRubyObject value)
           
static RubyClass createStructClass(Ruby runtime)
           
 IRubyObject each_pair(Block block)
           
 IRubyObject each(Block block)
           
 IRubyObject eql_p(IRubyObject other)
           
 IRubyObject equal(IRubyObject other)
          rb_equal
 IRubyObject get(Block block)
           
 int getNativeTypeIndex()
          This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.
 RubyFixnum hash()
           
 IRubyObject initialize_copy(IRubyObject arg)
          rb_obj_init_copy
 IRubyObject initialize(IRubyObject[] args, Block unusedBlock)
           
 IRubyObject inspect()
          rb_obj_inspect
static void marshalTo(RubyStruct struct, MarshalStream output)
           
 RubyArray members()
           
static RubyArray members(IRubyObject recv, Block block)
           
static RubyClass newInstance(IRubyObject recv, IRubyObject[] args, Block block)
          Create new Struct class.
static RubyStruct newStruct(IRubyObject recv, IRubyObject[] args, Block block)
          Create new Structure.
 IRubyObject rbClone(Block block)
          rb_obj_clone should be overriden only by: Proc, Method, UnboundedMethod, Binding
 IRubyObject set(IRubyObject value, Block block)
           
 RubyFixnum size()
           
 RubyArray to_a()
           
 IRubyObject to_s()
           
static RubyStruct unmarshalFrom(UnmarshalStream input)
           
 IRubyObject values_at(IRubyObject[] args)
           
 
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, equalInternal, equals, evalSimple, evalUnder, evalWithBinding, extend, freeze, frozen, getInstanceVariable, getInstanceVariables, getInstanceVariablesSnapshot, getJavaClass, getMetaClass, getRuntime, getSingletonClass, getSingletonClassClone, getType, hashCode, id_deprecated, id, infectBy, inherited, initCopy, 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, 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
 

Constructor Detail

RubyStruct

public RubyStruct(Ruby runtime,
                  RubyClass rubyClass)
Constructor for RubyStruct.

Parameters:
runtime -
rubyClass -
Method Detail

createStructClass

public static RubyClass createStructClass(Ruby runtime)

getNativeTypeIndex

public int getNativeTypeIndex()
Description copied from class: RubyObject
This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.

Specified by:
getNativeTypeIndex in interface IRubyObject
Overrides:
getNativeTypeIndex in class RubyObject

hash

public RubyFixnum hash()
Overrides:
hash in class RubyObject

newInstance

public static RubyClass newInstance(IRubyObject recv,
                                    IRubyObject[] args,
                                    Block block)
Create new Struct class. MRI: rb_struct_s_def / make_struct


newStruct

public static RubyStruct newStruct(IRubyObject recv,
                                   IRubyObject[] args,
                                   Block block)
Create new Structure. MRI: struct_alloc


initialize

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

members

public static RubyArray members(IRubyObject recv,
                                Block block)

members

public RubyArray members()

set

public IRubyObject set(IRubyObject value,
                       Block block)

get

public IRubyObject get(Block block)

rbClone

public IRubyObject rbClone(Block block)
Description copied from class: RubyObject
rb_obj_clone should be overriden only by: Proc, Method, UnboundedMethod, Binding

Specified by:
rbClone in interface IRubyObject
Overrides:
rbClone in class RubyObject

equal

public IRubyObject equal(IRubyObject other)
Description copied from class: RubyObject
rb_equal

Specified by:
equal in interface IRubyObject
Overrides:
equal in class RubyObject

eql_p

public IRubyObject eql_p(IRubyObject other)

to_s

public IRubyObject to_s()
Overrides:
to_s in class RubyObject

inspect

public IRubyObject inspect()
Description copied from class: RubyObject
rb_obj_inspect

Specified by:
inspect in interface IRubyObject
Overrides:
inspect in class RubyObject

to_a

public RubyArray to_a()

size

public RubyFixnum size()

each

public IRubyObject each(Block block)

each_pair

public IRubyObject each_pair(Block block)

aref

public IRubyObject aref(IRubyObject key)

aset

public IRubyObject aset(IRubyObject key,
                        IRubyObject value)

values_at

public IRubyObject values_at(IRubyObject[] args)

marshalTo

public static void marshalTo(RubyStruct struct,
                             MarshalStream output)
                      throws java.io.IOException
Throws:
java.io.IOException

unmarshalFrom

public static RubyStruct unmarshalFrom(UnmarshalStream input)
                                throws java.io.IOException
Throws:
java.io.IOException

initialize_copy

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

Overrides:
initialize_copy in class RubyObject


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