public class RecordList extends Object implements Cloneable, Serializable, Iterable<Record>, RecordSerializable
Modifier and Type | Field and Description |
---|---|
static Logger |
log |
SERIALIZED_CLASS_NAME, TYPE
Constructor and Description |
---|
RecordList() |
RecordList(DataReader reader) |
RecordList(int initialCapacity) |
RecordList(Record... records) |
Modifier and Type | Method and Description |
---|---|
RecordList |
add(int index,
Record record)
Inserts a record at the specified position in this list, shifting any record at or after
index to the right. |
RecordList |
add(Record... records)
Appends all the specified records to the end of this list.
|
RecordList |
addAll(Collection<Record> records)
Appends all the records in the specified collection to the end of this list.
|
RecordList |
addAll(DataReader reader)
Writes all the records in the specified reader to the end of this list.
|
RecordList |
addAll(RecordList recordList)
Appends all the records in the specified
recordList to the end of this list. |
void |
clear() |
RecordList |
clone()
Returns a new RecordList that is a copy of this RecordList.
|
RecordList |
ensureCapacity(int minCapacity)
Increases the capacity of this
RecordList to allow it
to hold the specified number of elements if needed. |
RecordList |
findAll(Filter filter) |
int |
findFirst(Filter filter,
int from) |
int |
findLast(Filter filter,
int from) |
void |
forEach(Consumer<? super Record> consumer)
Performs the given action for each record in this list.
|
RecordList |
fromArrayValue(ArrayValue arrayValue) |
static RecordList |
fromBinary(byte[] bytes) |
static RecordList |
fromBinary(DataInput input) |
static RecordList |
fromBinary(InputStream inputStream) |
RecordList |
fromRecord(Record source)
Loads this instance's state from a record and returns
this (for fluid API call chaining). |
Record |
get(int index)
Returns the record at the specified position in this list.
|
int |
getRecordCount()
Returns the number of records in this list -- an alias for
size() . |
List<Record> |
getRecords()
Returns a list of records.
|
long |
getSizeInBytes() |
ArrayValue |
getValuesAsArray()
Returns a multi-dimensional, ArrayValue of ArrayValues of all the values in this list.
|
boolean |
isEmpty()
Returns true if this list contains no records.
|
boolean |
isNotEmpty()
Returns true if this list contains at least one record.
|
Iterator<Record> |
iterator()
Returns an iterator over the records in this list.
|
RecordList |
move(int oldIndex,
int newIndex)
Moves the index field at the
oldIndex to the newIndex , shifting any existing elements at or after newIndex to the right. |
Stream<Record> |
parallelStream()
Returns a parallel Stream of the records in this list.
|
RecordList |
set(int index,
Record record)
Replaces the record at the specified position in this list with a new record.
|
int |
size()
Returns the number of records in this list.
|
RecordList |
sort(RecordComparator comparator) |
RecordList |
sort(RecordComparator comparator,
boolean cacheFieldIndexes) |
Stream<Record> |
stream()
Returns a sequential Stream of the records in this list.
|
RecordList |
sublist(int fromIndex,
boolean cloneRecords) |
RecordList |
sublist(int fromIndex,
int toIndex,
boolean cloneRecords) |
ArrayValue |
toArrayValue() |
byte[] |
toBinary() |
void |
toBinary(DataOutput output) |
void |
toBinary(OutputStream outputStream) |
MemoryReader |
toDataReader() |
Record |
toRecord() |
String |
toString() |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
spliterator
fromArrayValue, fromArrayValue, fromArrayValue, fromJson, fromJson, newInstanceFromRecord, newInstanceFromRecord, toArrayValue, toJson, toJson, toJson, toRecord
newInstanceFromJson
public RecordList()
public RecordList(int initialCapacity)
public RecordList(Record... records)
public RecordList(DataReader reader)
public RecordList ensureCapacity(int minCapacity)
RecordList
to allow it
to hold the specified number of elements if needed.public RecordList clone()
public ArrayValue getValuesAsArray()
public void forEach(Consumer<? super Record> consumer)
public Stream<Record> parallelStream()
public int getRecordCount()
size()
.public int size()
public boolean isEmpty()
public boolean isNotEmpty()
public Record get(int index)
public RecordList add(Record... records)
public RecordList addAll(RecordList recordList)
recordList
to the end of this list.public RecordList addAll(Collection<Record> records)
public RecordList add(int index, Record record)
index
to the right.public RecordList set(int index, Record record)
public RecordList move(int oldIndex, int newIndex)
oldIndex
to the newIndex
, shifting any existing elements at or after newIndex
to the right.public RecordList addAll(DataReader reader)
public RecordList sublist(int fromIndex, int toIndex, boolean cloneRecords)
public RecordList sublist(int fromIndex, boolean cloneRecords)
public void clear()
public RecordList sort(RecordComparator comparator, boolean cacheFieldIndexes)
public RecordList sort(RecordComparator comparator)
public int findFirst(Filter filter, int from)
public int findLast(Filter filter, int from)
public RecordList findAll(Filter filter)
public long getSizeInBytes()
public Record toRecord()
toRecord
in interface RecordSerializable
public RecordList fromRecord(Record source)
RecordSerializable
this
(for fluid API call chaining).
For fluid API call chaining, the overridden method should change the declared return type to its class.fromRecord
in interface RecordSerializable
public byte[] toBinary()
public void toBinary(OutputStream outputStream)
public void toBinary(DataOutput output)
public static RecordList fromBinary(byte[] bytes)
public static RecordList fromBinary(InputStream inputStream)
public static RecordList fromBinary(DataInput input)
public ArrayValue toArrayValue()
public RecordList fromArrayValue(ArrayValue arrayValue)
public MemoryReader toDataReader()
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.