Class CompressionFlags
- java.lang.Object
-
- it.unimi.di.big.mg4j.index.CompressionFlags
-
public class CompressionFlags extends Object
A container for constants and enums related to index compression.Several MG4J index-related methods require a set of flags specified as a flag map, that is, an
EnumMap
from components to codings (see, e.g.,BitStreamIndexWriter
). For the special componentCompressionFlags.Component.PAYLOADS
, the only admissible value isnull
.Besides declaring the necessary enums, this class contains a parsing method that turns an array of the form component:coding into a flag map.
- Since:
- 1.2
- Author:
- Sebastiano Vigna
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CompressionFlags.Coding
A coding for an index component.static class
CompressionFlags.Component
A component of the index.
-
Field Summary
Fields Modifier and Type Field Description static Map<CompressionFlags.Component,CompressionFlags.Coding>
DEFAULT
Deprecated.As of MG4J 1.2, replaced byDEFAULT_STANDARD_INDEX
.static Map<CompressionFlags.Component,CompressionFlags.Coding>
DEFAULT_PAYLOAD_INDEX
An unmodifiable map representing the default flags for a payload-based index.static Map<CompressionFlags.Component,CompressionFlags.Coding>
DEFAULT_QUASI_SUCCINCT_INDEX
An unmodifiable map representing the default flags for a quasi-succinct index.static Map<CompressionFlags.Component,CompressionFlags.Coding>
DEFAULT_STANDARD_INDEX
An unmodifiable map representing the default flags for a standard index.static String
NONE
A string used byvalueOf(String[], Map)
to disable a component.
-
Constructor Summary
Constructors Constructor Description CompressionFlags()
-
Method Summary
Modifier and Type Method Description static Map<CompressionFlags.Component,CompressionFlags.Coding>
valueOf(String[] flag, Map<CompressionFlags.Component,CompressionFlags.Coding> defaultMap)
Returns a flag map corresponding to a given array of strings.
-
-
-
Field Detail
-
NONE
public static final String NONE
A string used byvalueOf(String[], Map)
to disable a component.- See Also:
- Constant Field Values
-
DEFAULT_STANDARD_INDEX
public static final Map<CompressionFlags.Component,CompressionFlags.Coding> DEFAULT_STANDARD_INDEX
An unmodifiable map representing the default flags for a standard index.
-
DEFAULT_QUASI_SUCCINCT_INDEX
public static final Map<CompressionFlags.Component,CompressionFlags.Coding> DEFAULT_QUASI_SUCCINCT_INDEX
An unmodifiable map representing the default flags for a quasi-succinct index.
-
DEFAULT_PAYLOAD_INDEX
public static final Map<CompressionFlags.Component,CompressionFlags.Coding> DEFAULT_PAYLOAD_INDEX
An unmodifiable map representing the default flags for a payload-based index.
-
DEFAULT
@Deprecated public static final Map<CompressionFlags.Component,CompressionFlags.Coding> DEFAULT
Deprecated.As of MG4J 1.2, replaced byDEFAULT_STANDARD_INDEX
.An unmodifiable map representing the default flags for a standard index.
-
-
Method Detail
-
valueOf
public static Map<CompressionFlags.Component,CompressionFlags.Coding> valueOf(String[] flag, Map<CompressionFlags.Component,CompressionFlags.Coding> defaultMap)
Returns a flag map corresponding to a given array of strings.This method takes an array of (possibly untrimmed) flag strings of the form component:coding and turns them into a flag map (see the introduction). The flag map can be initialised by an optional default map, and the special value NONE for coding may be used to delete a key (the corresponding key in the flag map will be missing).
It is acceptable that strings in the array have whitespace around.
- Parameters:
flag
- an array of (possibly untrimmed) flag strings of the form component:coding.defaultMap
- a optional flag map of default values, ornull
.- Returns:
- the corresponding flag map.
-
-