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

Version:
$Revision: 1.7 $
Author:
jpetersen

Field Summary
 
Fields inherited from class org.jruby.RubyObject
runtime
 
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY
 
Constructor Summary
RubyStruct(Ruby ruby, RubyClass rubyClass)
          Constructor for RubyStruct.
 
Method Summary
 IRubyObject aref(IRubyObject key)
           
 IRubyObject aset(IRubyObject key, IRubyObject value)
           
static RubyClass createStructClass(Ruby ruby)
           
 IRubyObject each()
           
 RubyBoolean equal(IRubyObject other)
          rb_obj_equal
 IRubyObject get()
           
 IRubyObject initialize(IRubyObject[] args)
           
 RubyString inspect()
          rb_obj_inspect
 void marshalTo(MarshalStream output)
          Method marshalTo.
 RubyArray members()
           
static RubyArray members(IRubyObject recv)
           
static RubyClass newInstance(IRubyObject recv, IRubyObject[] args)
          Create new Struct class.
static RubyStruct newStruct(IRubyObject recv, IRubyObject[] args)
          Create new Structure.
 IRubyObject rbClone()
          rb_obj_clone
 IRubyObject set(IRubyObject value)
           
 RubyFixnum size()
           
 RubyArray to_a()
           
 RubyString to_s()
           
static RubyStruct unmarshalFrom(UnmarshalStream input)
           
 
Methods inherited from class org.jruby.RubyObject
argCount, asSymbol, callbackFactory, callInit, callMethod, callMethod, callMethod, checkSafeString, convertToString, convertToType, convertType, createObjectClass, defineSingletonMethod, display, dup, equals, eval, eval, evalUnder, extend, extendObject, freeze, frozen, getInstanceVariable, getInstanceVariables, getJavaClass, getMetaClass, getRuntime, getSingletonClass, getType, hash, hashCode, hasInstanceVariable, id, infectBy, instance_eval, instance_of, instance_variables, instanceVariableNames, isFalse, isFrozen, isKindOf, isNil, isTaint, isTrue, kind_of, makeMetaClass, method_missing, method, methods, nilObject, private_methods, protected_methods, removeInstanceVariable, respond_to, respondsTo, send, setFrozen, setInstanceVariable, setInstanceVariable, setInstanceVariables, setMetaClass, setTaint, setupClone, singleton_methods, singletonMethodsAllowed, specificEval, taint, tainted, toString, type, untaint
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RubyStruct

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

Parameters:
ruby -
rubyClass -
Method Detail

createStructClass

public static RubyClass createStructClass(Ruby ruby)

newInstance

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


newStruct

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


initialize

public IRubyObject initialize(IRubyObject[] args)

members

public static RubyArray members(IRubyObject recv)

members

public RubyArray members()

set

public IRubyObject set(IRubyObject value)

get

public IRubyObject get()

rbClone

public IRubyObject rbClone()
Description copied from class: RubyObject
rb_obj_clone

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

equal

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

Overrides:
equal in class RubyObject

to_s

public RubyString to_s()
Overrides:
to_s in class RubyObject

inspect

public RubyString 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()
Overrides:
to_a in class RubyObject

size

public RubyFixnum size()

each

public IRubyObject each()

aref

public IRubyObject aref(IRubyObject key)

aset

public IRubyObject aset(IRubyObject key,
                        IRubyObject value)

marshalTo

public void marshalTo(MarshalStream output)
               throws java.io.IOException
Description copied from interface: IRubyObject
Method marshalTo.

Specified by:
marshalTo in interface IRubyObject
Overrides:
marshalTo in class RubyObject
Throws:
java.io.IOException

unmarshalFrom

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


Copyright © 2002 Jan Arne Petersen. All Rights Reserved.