Interface PqIntList
public interface PqIntList
Specialized list interface for INT32 values.
Provides primitive iteration without boxing overhead.
PqIntList scores = row.getIntList("scores");
for (var it = scores.iterator(); it.hasNext(); ) {
int score = it.nextInt();
}
// Or with forEach:
scores.forEach(score -> System.out.println(score));
-
Method Summary
Modifier and TypeMethodDescriptionvoidforEach(IntConsumer action) Perform an action for each element.intget(int index) Get an element by index.booleanisEmpty()Check if this list is empty.booleanisNull(int index) Check if an element is null by index.iterator()Get a primitive iterator over the elements.intsize()Get the number of elements in this list.int[]toArray()Convert to a primitive array.
-
Method Details
-
size
int size()Get the number of elements in this list.- Returns:
- the element count
-
isEmpty
boolean isEmpty()Check if this list is empty.- Returns:
- true if the list has no elements
-
get
int get(int index) Get an element by index.- Parameters:
index- the element index (0-based)- Returns:
- the int value
- Throws:
NullPointerException- if the element is nullIndexOutOfBoundsException- if index is out of range
-
isNull
boolean isNull(int index) Check if an element is null by index.- Parameters:
index- the element index (0-based)- Returns:
- true if the element is null
-
iterator
PrimitiveIterator.OfInt iterator()Get a primitive iterator over the elements.- Returns:
- a primitive int iterator
-
forEach
Perform an action for each element.- Parameters:
action- the action to perform
-
toArray
int[] toArray()Convert to a primitive array.- Returns:
- a new array containing all elements
-