Class IntegerPayload
- java.lang.Object
-
- it.unimi.di.big.mg4j.index.payload.AbstractPayload
-
- it.unimi.di.big.mg4j.index.payload.IntegerPayload
-
- All Implemented Interfaces:
Payload
,Serializable
,Comparable<Payload>
public class IntegerPayload extends AbstractPayload
A payload containing a long stored using δ coding.The method
set(Object)
will accept anyNumber
that is in the range allowed byFast.int2nat(long)
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class it.unimi.di.big.mg4j.index.payload.AbstractPayload
AbstractPayload.ComparatorPayloadPredicate
-
-
Constructor Summary
Constructors Constructor Description IntegerPayload()
-
Method Summary
Modifier and Type Method Description int
compareTo(Payload o)
boolean
compatibleWith(Payload payload)
Returns true if this payload instance is compatible with another instance.IntegerPayload
copy()
Returns a copy of this payload.boolean
equals(Payload o)
Long
get()
Returns the value of this payload.long
getLong()
int
hashCode()
Long
parse(String spec)
int
read(InputBitStream ibs)
Sets the current value of this payload by reading from an input bit stream.void
set(long value)
Sets the current value of this payload.void
set(Object value)
Sets the current value of this payload.String
toString()
int
write(OutputBitStream obs)
Serialises the current value of this payload to the given output bit stream.-
Methods inherited from class it.unimi.di.big.mg4j.index.payload.AbstractPayload
rangeFilter
-
-
-
-
Field Detail
-
unset
protected boolean unset
Whether this payload has been ever set.
-
value
protected long value
The current value of this payload, ifunset
is false.
-
-
Method Detail
-
get
public Long get()
Description copied from interface:Payload
Returns the value of this payload.Implementing classes are expected to override covariantly the return value to the actual class stored by the payload.
- Returns:
- the current value of this payload.
-
getLong
public long getLong()
-
set
public void set(long value)
Sets the current value of this payload.- Parameters:
value
- the new value of this payload (must be in the range allowed byFast.int2nat(long)
).
-
set
public void set(Object value)
Description copied from interface:Payload
Sets the current value of this payload.- Parameters:
value
- the new value of this payload.
-
read
public int read(InputBitStream ibs) throws IOException
Description copied from interface:Payload
Sets the current value of this payload by reading from an input bit stream.- Parameters:
ibs
- a bit stream.- Returns:
- the number of bits read.
- Throws:
IOException
-
write
public int write(OutputBitStream obs) throws IOException
Description copied from interface:Payload
Serialises the current value of this payload to the given output bit stream.- Parameters:
obs
- the bit stream receiving the bits.- Returns:
- the number of bits written.
- Throws:
IOException
-
copy
public IntegerPayload copy()
Description copied from interface:Payload
Returns a copy of this payload.Implementing classes are expected to override covariantly the return value to the actual payload type.
- Returns:
- a copy of this payload.
-
compatibleWith
public boolean compatibleWith(Payload payload)
Description copied from interface:Payload
Returns true if this payload instance is compatible with another instance.- Returns:
- true if this payload instance is compatible with another instance.
-
compareTo
public int compareTo(Payload o)
-
equals
public boolean equals(Payload o)
-
-