public final class Flag
extends java.lang.Object
A flag is a encoded with a single byte, which itself contains two parts:
There are four flag types, for:
The meaning of the subflag depends on the flag type:
| Modifier and Type | Class and Description |
|---|---|
static class |
Flag.Type |
| Modifier and Type | Field and Description |
|---|---|
static Flag |
COUNT
Encodes the total count.
|
static Flag |
MAX
Encodes the global maximum value.
|
static Flag |
MIN
Encodes the global minimum value.
|
static Flag |
SUM
Encodes the total sum.
|
static Flag |
ZERO_COUNT
Encodes the count of the zero bin.
|
| Modifier and Type | Method and Description |
|---|---|
static Flag |
decode(Input input)
Return a flag built from the data read from the provided
Input. |
void |
encode(Output output) |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
Flag.Type |
type() |
public static final Flag ZERO_COUNT
Encoding format:
public static final Flag COUNT
Encoding format:
public static final Flag SUM
Encoding format:
public static final Flag MIN
Encoding format:
public static final Flag MAX
Encoding format:
public Flag.Type type()
public void encode(Output output) throws java.io.IOException
java.io.IOExceptionpublic static Flag decode(Input input) throws java.io.IOException
Input.
Note that for performance reasons, there is no validation happening in this method while decoding the flag. As a consequence, the returned flag may not actually be a valid flag.
input - where to read frominputjava.io.IOException - if an IO exception is thrown while reading from the inputpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object