public class TransformationStrategies extends Object
TransformationStrategy| Constructor and Description |
|---|
TransformationStrategies() |
| Modifier and Type | Method and Description |
|---|---|
static TransformationStrategy<Long> |
fixedLong()
A transformation from longs to bit vectors that returns a fixed-size
Long.SIZE-bit vector. |
static <T extends BitVector> |
identity()
A trivial transformation for data already in
BitVector form. |
static <T extends CharSequence> |
iso()
A trivial transformation from strings to bit vectors that concatenates the lower eight bits of the UTF-16 representation.
|
static <T extends BitVector> |
prefixFree()
A transformation from bit vectors to bit vectors that guarantees that its results are prefix free.
|
static <T extends CharSequence> |
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 <T extends CharSequence> |
prefixFreeUtf16()
A trivial transformation from strings to bit vectors that concatenates the bits of the UTF-16 representation and completes
the representation with an NUL to guarantee lexicographical ordering and prefix-freeness.
|
static <T extends CharSequence> |
prefixFreeUtf32()
A transformation from strings to bit vectors that decods the UTF-16 representation into a UTF-32 representation
by decoding surrogate pairs, concatenates the bits of the UTF-32 representation and completes
the representation with an NUL to guarantee lexicographical ordering and prefix-freeness.
|
static <T extends CharSequence> |
utf16()
A trivial transformation from strings to bit vectors that concatenates the bits of the UTF-16 representation.
|
static <T extends CharSequence> |
utf32()
A transformation from strings to bit vectors that decods the UTF-16 representation into a UTF-32 representation
by decoding surrogate pairs, and then concatenates the bits of the UTF-32 representation.
|
static <T> Iterable<BitVector> |
wrap(Iterable<T> iterable,
TransformationStrategy<? super T> transformationStrategy)
Wraps a given iterable, returning an iterable that contains bit vectors.
|
static <T> Iterator<BitVector> |
wrap(Iterator<T> iterator,
TransformationStrategy<? super T> transformationStrategy)
Wraps a given iterator, returning an iterator that emits bit vectors.
|
static <T> List<BitVector> |
wrap(List<T> list,
TransformationStrategy<? super T> transformationStrategy)
Wraps a given list, returning a list that contains bit vectors.
|
public static <T extends BitVector> TransformationStrategy<T> identity()
BitVector form.public static <T extends CharSequence> TransformationStrategy<T> utf32()
public static <T extends CharSequence> TransformationStrategy<T> prefixFreeUtf32()
Note that strings provided to this strategy must not contain NULs.
public static <T extends CharSequence> TransformationStrategy<T> utf16()
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> prefixFreeUtf16()
Note that strings provided to this strategy must not contain 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.
public static TransformationStrategy<Long> fixedLong()
Long.SIZE-bit vector. Note that the
bit vectors have as first bit the most significant bit of the underlying long integer, so
lexicographical and numerical order do coincide for positive numbers.