it.unimi.dsi.util
Class PermutedFrontCodedStringList
java.lang.Object
it.unimi.dsi.fastutil.objects.AbstractObjectCollection<K>
it.unimi.dsi.fastutil.objects.AbstractObjectList<java.lang.CharSequence>
it.unimi.dsi.util.PermutedFrontCodedStringList
- All Implemented Interfaces:
- ObjectCollection<java.lang.CharSequence>, ObjectIterable<java.lang.CharSequence>, ObjectList<java.lang.CharSequence>, Stack<java.lang.CharSequence>, java.io.Serializable, java.lang.Comparable<java.util.List<? extends java.lang.CharSequence>>, java.lang.Iterable<java.lang.CharSequence>, java.util.Collection<java.lang.CharSequence>, java.util.List<java.lang.CharSequence>
public class PermutedFrontCodedStringList
- extends AbstractObjectList<java.lang.CharSequence>
- implements java.io.Serializable
A FrontCodedStringList
whose indices are permuted.
It may happen that a list of strings compresses very well
using front coding, but unfortunately alphabetical order is not
the right order for the strings in the list. Instances of this class
wrap an instance of FrontCodedStringList
together with a permutation π: inquiries with index i will
actually return the string with index πi.
- See Also:
- Serialized Form
Method Summary |
java.lang.CharSequence |
get(int index)
|
void |
get(int index,
MutableString s)
Returns the element at the specified position in this front-coded list by storing it in a mutable string. |
ObjectListIterator<java.lang.CharSequence> |
listIterator(int k)
|
static void |
main(java.lang.String[] arg)
|
int |
size()
|
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObjectList |
add, add, addAll, addAll, addElements, addElements, compareTo, contains, ensureIndex, ensureRestrictedIndex, equals, getElements, hashCode, indexOf, iterator, lastIndexOf, listIterator, objectListIterator, objectListIterator, objectSubList, peek, pop, push, remove, removeElements, set, size, subList, top, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
clear, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
Methods inherited from interface it.unimi.dsi.fastutil.Stack |
isEmpty |
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
frontCodedStringList
protected final FrontCodedStringList frontCodedStringList
- The underlying front-coded string list.
permutation
protected final int[] permutation
- The permutation.
PermutedFrontCodedStringList
public PermutedFrontCodedStringList(FrontCodedStringList frontCodedStringList,
int[] permutation)
- Creates a new permuted front-coded string list using a given front-coded string list and permutation.
- Parameters:
frontCodedStringList
- the underlying front-coded string list.permutation
- the underlying permutation.
get
public java.lang.CharSequence get(int index)
- Specified by:
get
in interface java.util.List<java.lang.CharSequence>
get
public void get(int index,
MutableString s)
- Returns the element at the specified position in this front-coded list by storing it in a mutable string.
- Parameters:
index
- an index in the list.s
- a mutable string that will contain the string at the specified position.
size
public int size()
- Specified by:
size
in interface java.util.Collection<java.lang.CharSequence>
- Specified by:
size
in interface java.util.List<java.lang.CharSequence>
listIterator
public ObjectListIterator<java.lang.CharSequence> listIterator(int k)
- Specified by:
listIterator
in interface ObjectList<java.lang.CharSequence>
- Specified by:
listIterator
in interface java.util.List<java.lang.CharSequence>
- Overrides:
listIterator
in class AbstractObjectList<java.lang.CharSequence>
main
public static void main(java.lang.String[] arg)
throws java.io.IOException,
java.lang.ClassNotFoundException,
JSAPException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
JSAPException