public final class VectorEntry extends Object implements Cloneable
Map.Entry
does for maps.
The entry class does not support a public setValue method; to set the
value at an entry on a mutable sparse vector, use
MutableSparseVector.set(VectorEntry, double)
.
This design allows the same VectorEntry to work for both Mutable
and Immutable vectors, since the Immutable vectors can safely
return the VectorEntry knowing it cannot change the (immutable)
values, while the set operation on Mutable vectors allows the
element to be changed.
Modifier and Type | Class and Description |
---|---|
static class |
VectorEntry.State
The state of an entry in a sparse vector.
|
Modifier and Type | Method and Description |
---|---|
VectorEntry |
clone() |
long |
getKey()
Get the key at this entry.
|
double |
getValue()
Get the value at this entry.
|
SparseVector |
getVector()
Get the sparse vector associated with this entry.
|
boolean |
isSet()
Query whether this entry is set.
|
String |
toString() |
public long getKey()
public double getValue()
public boolean isSet()
true
if the entry's key is in the key set; false
if
it is only in the key domain.@Nullable public SparseVector getVector()
null
if no vector is linked.public VectorEntry clone()