Package be.bagofwords.db.data
Class CountsList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<be.bagofwords.util.Pair<Long,Long>>
-
- be.bagofwords.db.data.CountsList
-
- All Implemented Interfaces:
be.bagofwords.util.ByteArraySerializable,Serializable,Cloneable,Iterable<be.bagofwords.util.Pair<Long,Long>>,Collection<be.bagofwords.util.Pair<Long,Long>>,List<be.bagofwords.util.Pair<Long,Long>>,RandomAccess
public class CountsList extends ArrayList<be.bagofwords.util.Pair<Long,Long>> implements be.bagofwords.util.ByteArraySerializable
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description CountsList()CountsList(byte[] serialized)CountsList(int initialSize)CountsList(long key, int count)CountsList(CountsList list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCount(long key, long count)CountsListclone()voidcompact()longgetCount(long key)List<Long>getSortedKeys()longgetTotal()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
-
CountsList
public CountsList()
-
CountsList
public CountsList(CountsList list)
-
CountsList
public CountsList(long key, int count)
-
CountsList
public CountsList(int initialSize)
-
CountsList
public CountsList(byte[] serialized)
-
-
Method Detail
-
getCount
public long getCount(long key)
-
addCount
public void addCount(long key, long count)
-
getTotal
public long getTotal()
-
clone
public CountsList clone()
-
compact
public void compact()
-
hashCode
public int hashCode()
-
toString
public String toString()
- Overrides:
toStringin classAbstractCollection<be.bagofwords.util.Pair<Long,Long>>
-
toByteArray
public byte[] toByteArray()
- Specified by:
toByteArrayin interfacebe.bagofwords.util.ByteArraySerializable
-
-