public class RubyDataByteArray
extends org.jruby.RubyObject
RubyDataBag
.ALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F
Modifier | Constructor and Description |
---|---|
protected |
RubyDataByteArray(org.jruby.Ruby ruby,
org.jruby.RubyClass rc)
This constructor encapsulated a null DataByteArray.
|
protected |
RubyDataByteArray(org.jruby.Ruby ruby,
org.jruby.RubyClass rc,
byte[] buf)
This constructor creates a new DataByteArray with a reference to the provided bytes.
|
protected |
RubyDataByteArray(org.jruby.Ruby ruby,
org.jruby.RubyClass rc,
DataByteArray dba)
Given a DataByteArray, this constructor creates a new one which copies the underlying bytes.
|
protected |
RubyDataByteArray(org.jruby.Ruby ruby,
org.jruby.RubyClass rc,
DataByteArray dba1,
DataByteArray dba2)
This constructor makes a RubyDataByteArray whose underlying bytes are a concatenation
of the given bytes.
|
Modifier and Type | Method and Description |
---|---|
void |
append(org.jruby.runtime.ThreadContext context,
org.jruby.runtime.builtin.IRubyObject arg)
This calls to the append function of the underlying DataByteArray.
|
static org.jruby.RubyFixnum |
compare(org.jruby.runtime.ThreadContext context,
org.jruby.runtime.builtin.IRubyObject self,
org.jruby.runtime.builtin.IRubyObject arg1,
org.jruby.runtime.builtin.IRubyObject arg2)
This calls to the static method compare of DataByteArray.
|
org.jruby.RubyFixnum |
compareTo(org.jruby.runtime.ThreadContext context,
org.jruby.runtime.builtin.IRubyObject arg)
This calls the compareTo method of the encapsulated DataByteArray.
|
static org.jruby.RubyClass |
define(org.jruby.Ruby runtime)
Registers the DataByteArray class with the Ruby runtime.
|
org.jruby.RubyBoolean |
equals(org.jruby.runtime.ThreadContext context,
org.jruby.runtime.builtin.IRubyObject arg)
Overrides equality leveraging DataByteArray's equality.
|
DataByteArray |
getDBA() |
org.jruby.runtime.builtin.IRubyObject |
hash(org.jruby.runtime.ThreadContext context)
Overrides ruby's hash leveraging DataByteArray's hash.
|
RubyDataByteArray |
initialize()
This is the default initializer, which returns an empty DataByteArray.
|
RubyDataByteArray |
initialize(org.jruby.runtime.builtin.IRubyObject arg)
Given a String or a set of bytes[], initializes the encapsulated DataByteArray
using
DataByteArray.set(byte[]) . |
RubyDataByteArray |
initialize(org.jruby.runtime.builtin.IRubyObject arg1,
org.jruby.runtime.builtin.IRubyObject arg2)
Given two RubyDataByteArrays, initializes the encapsulated DataByteArray
to be a concatentation of the copied bits of the first and second.
|
org.jruby.runtime.builtin.IRubyObject |
plus(org.jruby.runtime.ThreadContext context,
org.jruby.runtime.builtin.IRubyObject arg)
This method accepts as an argument anything that could be passed to set (ie a
RubyDataByteArray, RubyString, or byte array).
|
void |
set(org.jruby.runtime.builtin.IRubyObject arg)
This method calls the set method of the underlying DataByteArray with one exception:
if given a RubyDataByteArray, it will set the encapsulated DataByteArray to be equal.
|
org.jruby.RubyFixnum |
size(org.jruby.runtime.ThreadContext context) |
org.jruby.runtime.builtin.IRubyObject |
toString(org.jruby.runtime.ThreadContext context) |
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, equals, getNativeTypeIndex, hashCode, initialize, op_eqq, puts, specificEval, toString
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, display, dup, ensureInstanceVariablesSettable, eql_p, eql, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, getVariableTableForRead, getVariableTableForWrite, hash, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id_deprecated, id, infectBy, initialize_copy, initialize19, initialize19, initialize19, initialize19, initialize19, initObjectId, inspect, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval19, instance_eval19, instance_eval19, instance_eval19, instance_exec, instance_exec19, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, instance_variables19, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method_missing19, method, method19, methods, methods, methods19, nil_p, op_cmp, op_equal_19, op_equal, op_match, op_match19, op_not_equal, op_not_match, op_not, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respond_to_p19, respond_to_p19, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, send19, send19, send19, send19, send19, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setTaint, setUntrusted, setVariable, singleton_method_added19, singleton_method_removed19, singleton_method_undefined19, singleton_methods, singleton_methods19, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, to_s, toJava, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
protected RubyDataByteArray(org.jruby.Ruby ruby, org.jruby.RubyClass rc)
ruby
- an instance of the ruby runtimerc
- an instance of the class object with meatadataprotected RubyDataByteArray(org.jruby.Ruby ruby, org.jruby.RubyClass rc, DataByteArray dba)
ruby
- an instance of the ruby runtimerc
- an instance of the class object with meatadatadba
- a DataByteArray to copy then encapsulateprotected RubyDataByteArray(org.jruby.Ruby ruby, org.jruby.RubyClass rc, DataByteArray dba1, DataByteArray dba2)
ruby
- an instance of the ruby runtimerc
- an instance of the class object with meatadatadba1
- first DataByteArray in the concatentationdba2
- second DAtaByteArray whose bytes will be concatenated to the first'sprotected RubyDataByteArray(org.jruby.Ruby ruby, org.jruby.RubyClass rc, byte[] buf)
ruby
- an instance of the ruby runtimerc
- an instance of the class object with meatadatabuf
- a byte array to encapsulate directlypublic static org.jruby.RubyClass define(org.jruby.Ruby runtime)
runtime
- an instance of the Ruby runtimepublic DataByteArray getDBA()
public RubyDataByteArray initialize()
initialize
in class org.jruby.RubyObject
public RubyDataByteArray initialize(org.jruby.runtime.builtin.IRubyObject arg)
DataByteArray.set(byte[])
. In the case of a DataByteArray, will copy
the underlying bytes.arg
- a value to set the encapsulated DataByteArray to. A DataByteArray
will be copied, whereas a byte array will be encapsulated directly,
and a string's bits will be used per DataByteArray.set(byte[])
.public RubyDataByteArray initialize(org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2)
arg1
- the first RubyDataByteArray whose bits will be usedarg2
- the second RubyDataByteArray whose bits will be concatenated
after the first'spublic void append(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg)
context
- the context the method is being executed inarg
- a value to append to the encpasulated DataByteArray. In the case of a
RubyDataByteArray, the bytes will be copied and appended; in the case
of a String, the bits will be added; in the case of a byte array,
the bytes will be appended directly.public static org.jruby.RubyFixnum compare(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2)
context
- the context the method is being executed inself
- an class which contains metadata on the calling class (required for static Ruby methods)arg1
- a RubyDataByteArray or byte array to comparearg2
- a RubyDataByteArray or byte array to comparepublic org.jruby.RubyFixnum compareTo(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg)
context
- the context the method is being executed inarg
- a RubyDataByteArray or byte array to compare to the
encapsulated DataByteArraypublic org.jruby.RubyBoolean equals(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg)
context
- the context the method is being executed inarg
- a RubyDataByteArray against which to test equalitypublic org.jruby.runtime.builtin.IRubyObject hash(org.jruby.runtime.ThreadContext context)
context
- the context the method is being executed inpublic void set(org.jruby.runtime.builtin.IRubyObject arg)
arg
- an object to set the encapsulated DataByteArray's bits to. In the case of
a RubyString or byte array, the underlying bytes will be sit directly. In
the case of a RubyDataByteArray, the encapsulated DataByteArray will be set
equal to arg.public org.jruby.RubyFixnum size(org.jruby.runtime.ThreadContext context)
context
- the context the method is being executed inpublic org.jruby.runtime.builtin.IRubyObject plus(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg)
context
- the context the method is being executed inarg
- any argument that can validly initialize a RubyDataByteArraypublic org.jruby.runtime.builtin.IRubyObject toString(org.jruby.runtime.ThreadContext context)
context
- the context the method is being executed inCopyright © 2007-2012 The Apache Software Foundation