Package be.bagofwords.db.data
Class DoubleCountsList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<be.bagofwords.util.Pair<Long,Double>>
-
- be.bagofwords.db.data.DoubleCountsList
-
- All Implemented Interfaces:
be.bagofwords.util.ByteArraySerializable,Serializable,Cloneable,Iterable<be.bagofwords.util.Pair<Long,Double>>,Collection<be.bagofwords.util.Pair<Long,Double>>,List<be.bagofwords.util.Pair<Long,Double>>,RandomAccess
public class DoubleCountsList extends ArrayList<be.bagofwords.util.Pair<Long,Double>> implements be.bagofwords.util.ByteArraySerializable
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description DoubleCountsList()DoubleCountsList(byte[] serialized)DoubleCountsList(int initialSize)DoubleCountsList(long key, int count)DoubleCountsList(DoubleCountsList list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCount(long key, double count)DoubleCountsListclone()voidcompact()doublegetCount(long key)List<Long>getSortedKeys()doublegetTotal()inthashCode()byte[]toByteArray()StringtoString()-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, contains, ensureCapacity, equals, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
Constructor Detail
-
DoubleCountsList
public DoubleCountsList()
-
DoubleCountsList
public DoubleCountsList(DoubleCountsList list)
-
DoubleCountsList
public DoubleCountsList(long key, int count)
-
DoubleCountsList
public DoubleCountsList(int initialSize)
-
DoubleCountsList
public DoubleCountsList(byte[] serialized)
-
-
Method Detail
-
getCount
public double getCount(long key)
-
addCount
public void addCount(long key, double count)
-
getTotal
public double getTotal()
-
clone
public DoubleCountsList clone()
-
compact
public void compact()
-
hashCode
public int hashCode()
-
toString
public String toString()
- Overrides:
toStringin classAbstractCollection<be.bagofwords.util.Pair<Long,Double>>
-
toByteArray
public byte[] toByteArray()
- Specified by:
toByteArrayin interfacebe.bagofwords.util.ByteArraySerializable
-
-