bytes
object.
Modifier and Type | Class and Description |
---|---|
pack-priv class | PyBytes.BytesDelegate
A class to act as the delegate implementing |
private class | PyBytes.BytesSpliterator
Inner class defining the return type of
|
private static class | PyBytes.ByteStore
A consumer of primitive int values that stores them in an array given it at construction. |
Modifier and Type | Field and Description |
---|---|
private PyBytes. | delegate
Helper to implement |
pack-priv static final PyBytes | |
private static final byte[] | |
public static final PyType | TYPE
The type of Python object this class implements. |
protected final PyType | type
The Python type of this instance. |
pack-priv final byte[] | value
The elements of the |
Access | Constructor and Description |
---|---|
private | PyBytes(PyType
sub-type for which this is being created type, boolean if iPromiseNotToModify, byte[] true , the array becomes the
implementation array, otherwise the constructor takes a copy.the array of the bytes to contain value)As |
protected | PyBytes(PyType
sub-type for which this is being created type, byte[] of the bytes value)As |
protected | PyBytes(PyType
sub-type for which this is being created type, int... of the bytes value)As |
public | |
public | PyBytes(int...
of the bytes value)Construct a Python |
public |
Modifier and Type | Method and Description |
---|---|
private Object | |
private Object | |
private int | |
private Object | |
private Object | |
private Object | |
pack-priv static PyBytes. | |
public byte[] | |
public PySequence. | Returns: sequence ofint Expose the contents of the object as a read-only sequence of
|
private static PyBytes | |
public Integer | get(int
index of the element to return i)Implements abstract java. Implements java. |
public ByteBuffer | Returns: a Java NIO bufferExpose the contents of the object as a read-only
|
public PyType | |
public Iterator | iterator()
Overrides java. Implements java. |
public int | size()
Implements abstract java. Implements java. |
private static PyBytes |
delegate | back to summary |
---|---|
private PyBytes. Helper to implement |
EMPTY | back to summary |
---|---|
pack-priv static final PyBytes EMPTY |
EMPTY_BYTE_ARRAY | back to summary |
---|---|
private static final byte[] EMPTY_BYTE_ARRAY |
TYPE | back to summary |
---|---|
public static final PyType TYPE The type of Python object this class implements. |
type | back to summary |
---|---|
protected final PyType type The Python type of this instance. |
value | back to summary |
---|---|
pack-priv final byte[] value The elements of the |
PyBytes | back to summary |
---|---|
private PyBytes(PyType type, boolean iPromiseNotToModify, byte[] value) As
|
PyBytes | back to summary |
---|---|
protected PyBytes(PyType type, byte[] value) As
|
PyBytes | back to summary |
---|---|
protected PyBytes(PyType type, int... value) As
|
PyBytes | back to summary |
---|---|
public PyBytes(byte[] value) Construct a Python
|
PyBytes | back to summary |
---|---|
public PyBytes(int... value) Construct a Python
|
PyBytes | back to summary |
---|---|
public PyBytes(ByteArrayBuilder value) Construct a Python
|
__add__ | back to summary |
---|---|
private Object __add__(Object other) throws Throwable
|
__getitem__ | back to summary |
---|---|
private Object __getitem__(Object item) throws Throwable
|
__len__ | back to summary |
---|---|
private int __len__()
|
__mul__ | back to summary |
---|---|
private Object __mul__(Object n) throws Throwable
|
__radd__ | back to summary |
---|---|
private Object __radd__(Object other) throws Throwable
|
__rmul__ | back to summary |
---|---|
private Object __rmul__(Object n) throws Throwable
|
adapt | back to summary |
---|---|
pack-priv static PyBytes. Adapt a Python object to a sequence of Java
Note that implementing
|
asByteArray | back to summary |
---|---|
public byte[] asByteArray() Return the contents of the object as an array of of
|
asSequence | back to summary |
---|---|
public PySequence. Expose the contents of the object as a read-only sequence of
|
concatBytes | back to summary |
---|---|
private static PyBytes concatBytes(PySequence. |
get | back to summary |
---|---|
public Integer get(int i) Implements abstract java. Implements java. Doc from java. Returns the element at the specified position in this list.
|
getNIOByteBuffer | back to summary |
---|---|
public ByteBuffer getNIOByteBuffer() Expose the contents of the object as a read-only
|
getType | back to summary |
---|---|
public PyType getType() Implements org. Doc from org. The Python |
iterator | back to summary |
---|---|
public Iterator Overrides java. Implements java. Doc from java. Returns an iterator over the elements in this list in proper sequence. |
size | back to summary |
---|---|
public int size() Implements abstract java. Implements java. Doc from java. Returns the number of elements in this list. If this list contains
more than
|
wrap | back to summary |
---|---|
private static PyBytes wrap(byte[] value) Unsafely wrap an array of bytes as a
|
__getitem__
and other index-related operations. By inheriting PySequence.Delegate
in this inner class, we obtain boilerplate
implementation code for slice translation and range checks. We
need only specify the work specific to PyBytes
instances.
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
pack-priv PyBytes | add(Object
the right operand ow)Implements abstract org. __add__ on the client sequence,
called by __add__(Object) .
|
public IntStream | asIntStream()
Implements org. int .
|
public int | compareTo(PySequence.
the object to be compared. otherImplements java. |
pack-priv boolean | Returns: whether values equalanother bCompare for equality with a sequence. |
public int | getInt(int
index i)Implements org. i .
|
public Integer | getItem(int
index of item to return i)Implements abstract org. __getitem__ , called by
__getitem__(Object) when its argument is an integer.
|
public PyBytes | getSlice(PySlice.
containing [start, stop, step, count] of the slice
to return sliceImplements abstract org. __getitem__ , called by
__getitem__(Object) when its argument is a
PySlice .
|
public PyType | getType()
Implements abstract org. |
public Iterator | |
public int | length()
Implements abstract org. Implements org. |
pack-priv PyBytes | radd(Object
the left operand ov)Implements abstract org. __radd__ on the client sequence,
called by __radd__(Object) .
|
pack-priv PyBytes | repeat(int
the number of repetitions n)Implements abstract org. __mul__ on the client sequence,
called by __mul__(Object) .
|
public Spliterator. | spliterator()
Overrides default org. Implements org. Spliterator over the elements described by this
Iterable .
|
BytesDelegate | back to summary |
---|---|
pack-priv BytesDelegate() |
add | back to summary |
---|---|
pack-priv PyBytes add(Object ow) throws OutOfMemoryError, NoConversion, Throwable Implements abstract org. Doc from org. Inner implementation of
The implementation of this method is responsible for validating
the argument. If an
|
asIntStream | back to summary |
---|---|
public IntStream asIntStream() Implements org. Doc from org. Provide a stream specialised to primitive |
compareTo | back to summary |
---|---|
public int compareTo(PySequence. Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
|
equals | back to summary |
---|---|
pack-priv boolean equals(PyBytes. Compare for equality with a sequence. This is a little simpler
than
|
getInt | back to summary |
---|---|
public int getInt(int i) Implements org. Doc from org. Get the int item from the sequence at a given index
|
getItem | back to summary |
---|---|
public Integer getItem(int i) Implements abstract org. Doc from org. Inner implementation of |
getSlice | back to summary |
---|---|
public PyBytes getSlice(PySlice. Implements abstract org. Doc from org. Inner implementation of |
getType | back to summary |
---|---|
public PyType getType() Implements abstract org. Doc from org. Provide the type of client sequence, primarily for use in error messages e.g. "TYPE index out of bounds". |
iterator | back to summary |
---|---|
public Iterator Implements java. Doc from java. Returns an iterator over elements of type |
length | back to summary |
---|---|
public int length() Implements abstract org. Implements org. Doc from org. The length of this sequence.
|
radd | back to summary |
---|---|
pack-priv PyBytes radd(Object ov) throws OutOfMemoryError, NoConversion, Throwable Implements abstract org. Doc from org. Inner implementation of
The implementation of this method is responsible for validating
the argument. If an
|
repeat | back to summary |
---|---|
pack-priv PyBytes repeat(int n) throws OutOfMemoryError, Throwable Implements abstract org. Doc from org. Inner implementation of
|
spliterator | back to summary |
---|---|
public Spliterator. Overrides default org. Implements org. Doc from org. Creates a
|
PyBytes#spliterator()
. We need this only because
tryAdvance
deals in java
int
s, while our array is byte[]
. There is no
ready-made Spliterator.OfByte
, and if there were, it
would return signed values.
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
public boolean | tryAdvance(IntConsumer
The action action)Implements java. true ; else returns false .
|
BytesSpliterator | back to summary |
---|---|
pack-priv BytesSpliterator() |
tryAdvance | back to summary |
---|---|
public boolean tryAdvance(IntConsumer action) Implements java. Doc from java. If a remaining element exists, performs the given action on it,
returning Subsequent behavior of a spliterator is unspecified if the action throws an exception.
|
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
public void | accept(int
the input argument value)Implements java. |
ByteStore | back to summary |
---|---|
pack-priv ByteStore(byte[] bytes, int start) |
accept | back to summary |
---|---|
public void accept(int value) Implements java. Doc from java. Performs this operation on the given argument.
|