it.unimi.di.mg4j.index
Class CompressionFlags

java.lang.Object
  extended by it.unimi.di.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 component CompressionFlags.Component.PAYLOADS, the only admissible value is null.

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
static class CompressionFlags.Coding
          A coding for an index component.
static class CompressionFlags.Component
          A component of the index.
 
Field Summary
static Map<CompressionFlags.Component,CompressionFlags.Coding> DEFAULT
          Deprecated. As of MG4J 1.2, replaced by DEFAULT_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 by valueOf(String[], Map) to disable a component.
 
Constructor Summary
CompressionFlags()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final String NONE
A string used by valueOf(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 by DEFAULT_STANDARD_INDEX.
An unmodifiable map representing the default flags for a standard index.

Constructor Detail

CompressionFlags

public CompressionFlags()
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, or null.
Returns:
the corresponding flag map.