public class PermutedFrontCodedStringList extends it.unimi.dsi.fastutil.objects.AbstractObjectList<CharSequence> implements Serializable
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.
Modifier and Type | Field and Description |
---|---|
protected FrontCodedStringList |
frontCodedStringList
The underlying front-coded string list.
|
protected int[] |
permutation
The permutation.
|
static long |
serialVersionUID |
Constructor and Description |
---|
PermutedFrontCodedStringList(FrontCodedStringList frontCodedStringList,
int[] permutation)
Creates a new permuted front-coded string list using a given front-coded string list and permutation.
|
Modifier and Type | Method and Description |
---|---|
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.
|
it.unimi.dsi.fastutil.objects.ObjectListIterator<CharSequence> |
listIterator(int k) |
static void |
main(String[] arg) |
int |
size() |
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
containsAll, isEmpty, objectIterator, removeAll, retainAll, toArray, toArray
clear, remove
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
clear, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
public static final long serialVersionUID
protected final FrontCodedStringList frontCodedStringList
protected final int[] permutation
public PermutedFrontCodedStringList(FrontCodedStringList frontCodedStringList, int[] permutation)
frontCodedStringList
- the underlying front-coded string list.permutation
- the underlying permutation.public CharSequence get(int index)
get
in interface List<CharSequence>
public void get(int index, MutableString s)
index
- an index in the list.s
- a mutable string that will contain the string at the specified position.public int size()
size
in interface Collection<CharSequence>
size
in interface List<CharSequence>
size
in class AbstractCollection<CharSequence>
public it.unimi.dsi.fastutil.objects.ObjectListIterator<CharSequence> listIterator(int k)
listIterator
in interface it.unimi.dsi.fastutil.objects.ObjectList<CharSequence>
listIterator
in interface List<CharSequence>
listIterator
in class it.unimi.dsi.fastutil.objects.AbstractObjectList<CharSequence>
public static void main(String[] arg) throws IOException, ClassNotFoundException, com.martiansoftware.jsap.JSAPException
IOException
ClassNotFoundException
com.martiansoftware.jsap.JSAPException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.