it.unimi.dsi.util
Class PermutedFrontCodedStringList
java.lang.Object
java.util.AbstractCollection<K>
it.unimi.dsi.fastutil.objects.AbstractObjectCollection<K>
it.unimi.dsi.fastutil.objects.AbstractObjectList<CharSequence>
it.unimi.dsi.util.PermutedFrontCodedStringList
- All Implemented Interfaces:
- ObjectCollection<CharSequence>, ObjectIterable<CharSequence>, ObjectList<CharSequence>, Stack<CharSequence>, Serializable, Comparable<List<? extends CharSequence>>, Iterable<CharSequence>, Collection<CharSequence>, List<CharSequence>
public class PermutedFrontCodedStringList
- extends AbstractObjectList<CharSequence>
- implements 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
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 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 CharSequence get(int index)
- Specified by:
get
in interface List<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 Collection<CharSequence>
- Specified by:
size
in interface List<CharSequence>
- Specified by:
size
in class AbstractCollection<CharSequence>
listIterator
public ObjectListIterator<CharSequence> listIterator(int k)
- Specified by:
listIterator
in interface ObjectList<CharSequence>
- Specified by:
listIterator
in interface List<CharSequence>
- Overrides:
listIterator
in class AbstractObjectList<CharSequence>
main
public static void main(String[] arg)
throws IOException,
ClassNotFoundException,
JSAPException
- Throws:
IOException
ClassNotFoundException
JSAPException