org.jruby
Class RubyHash
java.lang.Object
org.jruby.RubyObject
org.jruby.RubyHash
- All Implemented Interfaces:
- java.lang.Cloneable, IRubyObject
- public class RubyHash
- extends RubyObject
Implementation of the Hash class.
- Version:
- $Revision: 1.9 $
- Author:
- jpetersen
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 |
RubyHash
public RubyHash(Ruby ruby)
RubyHash
public RubyHash(Ruby ruby,
IRubyObject defaultValue)
RubyHash
public RubyHash(Ruby ruby,
java.util.Map valueMap,
IRubyObject defaultValue)
nilHash
public static RubyHash nilHash(Ruby ruby)
getDefaultValue
public IRubyObject getDefaultValue()
setDefaultValue
public IRubyObject setDefaultValue(IRubyObject defaultValue)
getValueMap
public java.util.Map getValueMap()
setValueMap
public void setValueMap(java.util.Map valueMap)
createHashClass
public static RubyClass createHashClass(Ruby ruby)
modify
public void modify()
- rb_hash_modify
newHash
public static RubyHash newHash(Ruby ruby)
newHash
public static RubyHash newHash(Ruby ruby,
java.util.Map valueMap,
IRubyObject defaultValue)
newInstance
public static RubyHash newInstance(IRubyObject recv,
IRubyObject[] args)
create
public static RubyHash create(IRubyObject recv,
IRubyObject[] args)
initialize
public IRubyObject initialize(IRubyObject[] args)
inspect
public RubyString inspect()
- Description copied from class:
RubyObject
- rb_obj_inspect
- Specified by:
inspect
in interface IRubyObject
- Overrides:
inspect
in class RubyObject
size
public RubyFixnum size()
empty_p
public RubyBoolean empty_p()
to_a
public RubyArray to_a()
- Overrides:
to_a
in class RubyObject
to_s
public RubyString to_s()
- Overrides:
to_s
in class RubyObject
rbClone
public IRubyObject rbClone()
- Description copied from class:
RubyObject
- rb_obj_clone
- Specified by:
rbClone
in interface IRubyObject
- Overrides:
rbClone
in class RubyObject
rehash
public RubyHash rehash()
to_hash
public RubyHash to_hash()
aset
public IRubyObject aset(IRubyObject key,
IRubyObject value)
aref
public IRubyObject aref(IRubyObject key)
fetch
public IRubyObject fetch(IRubyObject[] args)
has_key
public RubyBoolean has_key(IRubyObject key)
has_value
public RubyBoolean has_value(IRubyObject value)
each
public RubyHash each()
each_value
public RubyHash each_value()
each_key
public RubyHash each_key()
sort
public RubyArray sort()
index
public IRubyObject index(IRubyObject value)
indices
public RubyArray indices(IRubyObject[] indices)
keys
public RubyArray keys()
values
public RubyArray values()
equal
public RubyBoolean equal(IRubyObject other)
- Description copied from class:
RubyObject
- rb_obj_equal
- Overrides:
equal
in class RubyObject
shift
public RubyArray shift()
delete
public IRubyObject delete(IRubyObject key)
delete_if
public RubyHash delete_if()
reject
public RubyHash reject()
reject_bang
public RubyHash reject_bang()
clear
public RubyHash clear()
invert
public RubyHash invert()
update
public RubyHash update(IRubyObject freshElements)
replace
public RubyHash replace(IRubyObject replacement)
values_at
public RubyArray values_at(IRubyObject[] argv)
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 RubyHash unmarshalFrom(UnmarshalStream input)
throws java.io.IOException
- Throws:
java.io.IOException
Copyright © 2002 Jan Arne Petersen. All Rights Reserved.