public class ArrayBuffer<E> extends ReadWriteBuffer<E,ArrayBuffer<E>>
| 构造器和说明 |
|---|
ArrayBuffer(E[] buf) |
ArrayBuffer(E[] buf,
int offset) |
ArrayBuffer(E[] buf,
int offset,
int length)
把指定的数组 包装为 ArrayBuffer,从 offset开始,包装长度为 length
|
ArrayBuffer(int maxCapacity) |
ArrayBuffer(int mark,
int pos,
int lim,
int cap,
E[] buf,
int offset) |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
array()
Returns the array that backs this
buffer (optional operation).
|
long |
arrayOffset()
Returns the offset within this buffer's backing array of the first
element of the buffer (optional operation).
|
E |
get() |
E |
get(long index) |
List<E> |
get(long index,
long maxLength) |
boolean |
hasArray()
Tells whether or not this buffer is backed by an accessible
array.
|
boolean |
isReadOnly()
Tells whether or not this buffer is read-only.
|
ArrayBuffer<E> |
put(Collection<E> es) |
ArrayBuffer<E> |
put(E e) |
ArrayBuffer<E> |
put(E[] es) |
ArrayBuffer<E> |
put(long index,
E e) |
void |
setReadonly(boolean readonly) |
capacity, checkIndex, clear, flip, hasRemaining, limit, limit, mark, nextGetIndex, nextGetIndex, nextPutIndex, position, position, remaining, reset, rewindpublic ArrayBuffer(int maxCapacity)
public ArrayBuffer(E[] buf)
public ArrayBuffer(E[] buf, int offset)
public ArrayBuffer(E[] buf, int offset, int length)
buf - public ArrayBuffer(int mark,
int pos,
int lim,
int cap,
E[] buf,
int offset)
public void setReadonly(boolean readonly)
public boolean isReadOnly()
BufferisReadOnly 在类中 Buffer<ArrayBuffer<E>>public boolean hasArray()
Buffer If this method returns true then the array
and arrayOffset methods may safely be invoked.
hasArray 在类中 Buffer<ArrayBuffer<E>>public Object array()
BufferThis method is intended to allow array-backed buffers to be passed to native code more efficiently. Concrete subclasses provide more strongly-typed return values for this method.
Modifications to this buffer's content will cause the returned array's content to be modified, and vice versa.
Invoke the hasArray method before invoking this
method in order to ensure that this buffer has an accessible backing
array.
array 在类中 Buffer<ArrayBuffer<E>>public long arrayOffset()
BufferIf this buffer is backed by an array then buffer position p corresponds to array index p + arrayOffset().
Invoke the hasArray method before invoking this
method in order to ensure that this buffer has an accessible backing
array.
arrayOffset 在类中 Buffer<ArrayBuffer<E>>public ArrayBuffer<E> put(@Nullable E e)
put 在类中 ReadWriteBuffer<E,ArrayBuffer<E>>public ArrayBuffer<E> put(long index, @Nullable E e)
put 在类中 ReadWriteBuffer<E,ArrayBuffer<E>>public ArrayBuffer<E> put(E[] es)
put 在类中 ReadWriteBuffer<E,ArrayBuffer<E>>public ArrayBuffer<E> put(Collection<E> es)
put 在类中 ReadWriteBuffer<E,ArrayBuffer<E>>public E get()
get 在类中 ReadWriteBuffer<E,ArrayBuffer<E>>public E get(long index)
get 在类中 ReadWriteBuffer<E,ArrayBuffer<E>>public List<E> get(long index, long maxLength)
get 在类中 ReadWriteBuffer<E,ArrayBuffer<E>>index - 起始位置maxLength - 最多获取数量,如果小于0 ,则从指定位置到limitCopyright © 2022. All rights reserved.