Interface PqDoubleList
public interface PqDoubleList
Specialized list interface for DOUBLE values.
Provides primitive iteration without boxing overhead.
-
Method Summary
Modifier and TypeMethodDescriptionvoidforEach(DoubleConsumer action) Perform an action for each element.doubleget(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.double[]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
double get(int index) Get an element by index.- Parameters:
index- the element index (0-based)- Returns:
- the double 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.OfDouble iterator()Get a primitive iterator over the elements.- Returns:
- a primitive double iterator
-
forEach
Perform an action for each element.- Parameters:
action- the action to perform
-
toArray
double[] toArray()Convert to a primitive array.- Returns:
- a new array containing all elements
-