public class WeightedList<T>
extends java.lang.Object
List
that keeps track of weight, for cache limit reasons.Constructor and Description |
---|
WeightedList(java.util.List<T> backing,
long weight) |
Modifier and Type | Method and Description |
---|---|
void |
accumulateWeight(long weight) |
void |
add(T element,
long weight) |
void |
addAll(java.util.List<T> values,
long weight) |
void |
addAll(WeightedList<T> values) |
java.util.List<T> |
getBacking() |
long |
getWeight() |
boolean |
isEmpty() |
int |
size() |
public WeightedList(java.util.List<T> backing, long weight)
public java.util.List<T> getBacking()
public int size()
public boolean isEmpty()
public long getWeight()
public void add(T element, long weight)
public void addAll(WeightedList<T> values)
public void addAll(java.util.List<T> values, long weight)
public void accumulateWeight(long weight)