|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.aitools.aq.invertedindex.core.Record<E>
public class Record<E extends Value>
A class to represent key-value-pair.
The key is a string, the value some specialization of Value
.
Field Summary | |
---|---|
static java.lang.String |
EMPTY_KEY
|
static char |
SEPARATOR
|
Constructor Summary | |
---|---|
Record(java.lang.Class<E> clazz)
The default constructor. |
|
Record(Record<E> record)
The copy constructor. |
|
Record(java.lang.String key,
E value)
The explicit constructor. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getKey()
Gets the key of this record. |
E |
getValue()
Get the value of the record. |
int |
hashCode()
|
void |
parseFrom(TokenStream in)
Parses all elements from a token stream. |
java.io.PrintStream |
printTo(java.io.PrintStream out)
|
java.io.PrintWriter |
printTo(java.io.PrintWriter out)
Prints all elements to an output stream. |
void |
set(java.lang.String key,
E value)
Sets both the key and the value at once. |
void |
setKey(java.lang.String key)
Sets the key of this record. |
void |
setValue(E value)
Sets the value of this record. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String EMPTY_KEY
public static final char SEPARATOR
Constructor Detail |
---|
public Record(java.lang.Class<E> clazz)
clazz
- the type information about the value class.
java.lang.IllegalAccessException
java.lang.InstantiationException
public Record(java.lang.String key, E value) throws Value.InvalidArgumentException
key
- the key as string.value
- the value as a typed postlist entry.
Value.InvalidArgumentException
- if key is empty or contains
any whitespace character.public Record(Record<E> record)
record
- the record to initialize this record.Method Detail |
---|
public java.lang.String getKey()
public E getValue()
public void parseFrom(TokenStream in) throws java.io.IOException
java.io.IOException
public java.io.PrintWriter printTo(java.io.PrintWriter out)
Object.toString()
, but for serialization purposes this method is
much faster since no temporal variables are needed.
public java.io.PrintStream printTo(java.io.PrintStream out)
public void setKey(java.lang.String key) throws Value.InvalidArgumentException
key
- the key as string.
Value.InvalidArgumentException
- if key is empty or contains
any whitespace character.public void setValue(E value)
value
- the value of this record.public void set(java.lang.String key, E value) throws Value.InvalidArgumentException
key
- the key of this record.value
- the value of this record.
Value.InvalidArgumentException
- if key is empty or contains
any whitespace character.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |