|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unimi.dsi.bits.TransformationStrategies
public class TransformationStrategies
A class providing static methods and objects that do useful things with transformation strategies.
TransformationStrategy
Constructor Summary | |
---|---|
TransformationStrategies()
|
Method Summary | ||
---|---|---|
static
|
identity()
A trivial transformation for data already in BitVector form. |
|
static
|
iso()
A trivial transformation from strings to bit vectors that concatenates the lower eight bits of the UTF-16 representation. |
|
static
|
prefixFree()
A transformation from bit vectors to bit vectors that guarantees that its results are prefix free. |
|
static
|
prefixFreeIso()
A trivial transformation from strings to bit vectors that concatenates the bits of the UTF-16 representation and completes the representation with an ASCII NUL to guarantee lexicographical ordering and prefix-freeness. |
|
static
|
prefixFreeUtf16()
A trivial transformation from strings to bit vectors that concatenates the bits of the UTF-16 representation and completes the representation with an ASCII NUL to guarantee lexicographical ordering and prefix-freeness. |
|
static
|
utf16()
A trivial transformation from strings to bit vectors that concatenates the bits of the UTF-16 representation. |
|
static
|
wrap(Iterable<T> iterable,
TransformationStrategy<? super T> transformationStrategy)
Wraps a given iterable, returning an iterable that contains bit vectors. |
|
static
|
wrap(Iterator<T> iterator,
TransformationStrategy<? super T> transformationStrategy)
Wraps a given iterator, returning an iterator that emits bit vectors. |
|
static
|
wrap(List<T> list,
TransformationStrategy<? super T> transformationStrategy)
Wraps a given list, returning a list that contains bit vectors. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TransformationStrategies()
Method Detail |
---|
public static <T extends BitVector> TransformationStrategy<T> identity()
BitVector
form.
public static <T extends CharSequence> TransformationStrategy<T> utf16()
public static <T extends CharSequence> TransformationStrategy<T> prefixFreeUtf16()
Note that strings provided to this strategy must not contain ASCII NULs. Warning: bit vectors returned by this strategy are adaptors around the original string. If the string changes while the bit vector is being accessed, the results will be unpredictable.
public static <T extends CharSequence> TransformationStrategy<T> iso()
Note that this transformation is sensible only for strings that are known to be contain just characters in the ISO-8859-1 charset. Warning: bit vectors returned by this strategy are adaptors around the original string. If the string changes while the bit vector is being accessed, the results will be unpredictable.
public static <T extends CharSequence> TransformationStrategy<T> prefixFreeIso()
Note that this transformation is sensible only for strings that are known to be contain just characters in the ISO-8859-1 charset, and that strings provided to this strategy must not contain ASCII NULs. Warning: bit vectors returned by this strategy are adaptors around the original string. If the string changes while the bit vector is being accessed, the results will be unpredictable.
public static <T> Iterator<BitVector> wrap(Iterator<T> iterator, TransformationStrategy<? super T> transformationStrategy)
iterator
- an iterator.transformationStrategy
- a strategy to transform the object returned by iterator
.
iterator
passed through transformationStrategy
.public static <T> Iterable<BitVector> wrap(Iterable<T> iterable, TransformationStrategy<? super T> transformationStrategy)
iterable
- an iterable.transformationStrategy
- a strategy to transform the object contained in iterable
.
iterable
passed through transformationStrategy
.public static <T> List<BitVector> wrap(List<T> list, TransformationStrategy<? super T> transformationStrategy)
list
- a list.transformationStrategy
- a strategy to transform the object contained in list
.
list
passed through transformationStrategy
.public static <T extends BitVector> TransformationStrategy<T> prefixFree()
More in detail, we map 0 to 10, 1 to 11, and we add a 0 at the end of all strings.
Warning: bit vectors returned by this strategy are adaptors around the original string. If the string changes while the bit vector is being accessed, the results will be unpredictable.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |