|
||||||||||
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.RubyStruct
public class RubyStruct
Nested Class Summary | |
---|---|
static class |
RubyStruct.StructMethods
|
Nested classes/interfaces inherited from class org.jruby.RubyObject |
---|
RubyObject.ObjectMethods |
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject |
---|
RubyBasicObject.BasicObjectMethods, RubyBasicObject.Finalizer, RubyBasicObject.VariableTableEntry |
Field Summary |
---|
Fields inherited from class org.jruby.RubyObject |
---|
OBJECT_ALLOCATOR |
Fields inherited from class org.jruby.RubyBasicObject |
---|
ALL_F, dataStruct, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, TAINTED_F, UNDEF, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, VARIABLE_TABLE_DEFAULT_CAPACITY, VARIABLE_TABLE_EMPTY_TABLE, VARIABLE_TABLE_LOAD_FACTOR, VARIABLE_TABLE_MAXIMUM_CAPACITY, variableTable, variableTableSize, variableTableThreshold |
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)
|
void |
copySpecialInstanceVariables(IRubyObject clone)
Lots of MRI objects keep their state in non-lookupable ivars (e:g. |
static RubyClass |
createStructClass(Ruby runtime)
|
IRubyObject |
each_pair(ThreadContext context,
Block block)
|
IRubyObject |
each_pair19(ThreadContext context,
Block block)
|
IRubyObject |
each(ThreadContext context,
Block block)
|
IRubyObject |
each19(ThreadContext context,
Block block)
|
IRubyObject |
eql_p(ThreadContext context,
IRubyObject other)
|
IRubyObject |
get(int index)
|
int |
getNativeTypeIndex()
This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are. |
RubyFixnum |
hash(ThreadContext context)
|
IRubyObject |
initialize_copy(IRubyObject arg)
rb_obj_init_copy Initializes this object as a copy of the original, that is the parameter to this object. |
IRubyObject |
initialize(IRubyObject[] args,
Block unusedBlock)
|
IRubyObject |
inspect(ThreadContext context)
|
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 |
op_equal(ThreadContext context,
IRubyObject other)
rb_obj_equal Will by default use identity equality to compare objects. |
RubyArray |
select(ThreadContext context,
Block block)
|
IRubyObject |
set(IRubyObject value,
int index)
|
RubyFixnum |
size()
|
RubyArray |
to_a()
rb_any_to_a call-seq: obj.to_a -> anArray Returns an array representation of obj. |
static RubyStruct |
unmarshalFrom(UnmarshalStream input)
|
IRubyObject |
values_at(IRubyObject[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RubyStruct(Ruby runtime, RubyClass rubyClass)
runtime
- rubyClass
- Method Detail |
---|
public static RubyClass createStructClass(Ruby runtime)
public int getNativeTypeIndex()
RubyObject
getNativeTypeIndex
in interface CoreObjectType
getNativeTypeIndex
in class RubyObject
org.jruby.runtime.ClassInde
public RubyFixnum hash(ThreadContext context)
public static RubyClass newInstance(IRubyObject recv, IRubyObject[] args, Block block)
public static RubyStruct newStruct(IRubyObject recv, IRubyObject[] args, Block block)
public IRubyObject initialize(IRubyObject[] args, Block unusedBlock)
public static RubyArray members(IRubyObject recv, Block block)
public RubyArray members()
public RubyArray select(ThreadContext context, Block block)
public IRubyObject set(IRubyObject value, int index)
public IRubyObject get(int index)
public void copySpecialInstanceVariables(IRubyObject clone)
RubyBasicObject
copySpecialInstanceVariables
in interface IRubyObject
copySpecialInstanceVariables
in class RubyBasicObject
public IRubyObject op_equal(ThreadContext context, IRubyObject other)
RubyObject
op_equal
in interface IRubyObject
op_equal
in class RubyObject
public IRubyObject eql_p(ThreadContext context, IRubyObject other)
public IRubyObject inspect(ThreadContext context)
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 RubyFixnum size()
public IRubyObject each(ThreadContext context, Block block)
public IRubyObject each19(ThreadContext context, Block block)
public IRubyObject each_pair(ThreadContext context, Block block)
public IRubyObject each_pair19(ThreadContext context, Block block)
public IRubyObject aref(IRubyObject key)
public IRubyObject aset(IRubyObject key, IRubyObject value)
public IRubyObject values_at(IRubyObject[] args)
public static void marshalTo(RubyStruct struct, MarshalStream output) throws java.io.IOException
java.io.IOException
public static RubyStruct unmarshalFrom(UnmarshalStream input) throws java.io.IOException
java.io.IOException
public IRubyObject initialize_copy(IRubyObject arg)
RubyObject
initialize_copy
in class RubyObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |