public class NTTableEntry
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static char |
HALF_OF_CHAR |
private char |
m_id |
private boolean |
m_isDirty |
private boolean |
m_isNew |
java.lang.String |
m_name
the name of the entry
|
private char |
m_sequenceNumber |
private NTEntryType |
m_type
the type of the entry
|
private java.lang.Object |
m_value |
static char |
UNKNOWN_ID
the id that represents that an id is unknown for an entry
|
| Constructor and Description |
|---|
NTTableEntry(char id,
java.lang.String name,
char sequenceNumber,
NTEntryType type,
java.lang.Object value)
Create a new entry with the given id, name, sequence number, type and value
|
NTTableEntry(java.lang.String name,
NTEntryType type,
java.lang.Object value)
Create a new entry with the given name, type, value, an unknown id and a sequence number of 0
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearId()
clear the id of the entry to unknown
|
void |
fireListener(NTEntryStore.TableListenerManager listenerManager) |
void |
forcePut(char newSequenceNumber,
NTEntryType type,
java.lang.Object newValue)
force a value and new sequence number upon an entry, Will also set the type of the entry
|
void |
forcePut(char newSequenceNumber,
java.lang.Object newValue)
force a value and new sequence number upon an entry
|
char |
getId() |
char |
getSequenceNumber() |
NTEntryType |
getType() |
java.lang.Object |
getValue() |
boolean |
isDirty() |
void |
makeClean() |
void |
makeDirty() |
boolean |
putValue(char newSequenceNumber,
java.lang.Object newValue)
set the value of the entry if the given sequence number is greater that the current sequence number
|
void |
send(NTConnection connection) |
void |
sendValue(java.io.DataOutputStream os)
Send the value of the entry over the output stream
|
void |
setId(char id)
Sets the id of the entry
|
java.lang.String |
toString() |
public static final char UNKNOWN_ID
private char m_id
private char m_sequenceNumber
public final java.lang.String m_name
private NTEntryType m_type
private java.lang.Object m_value
private volatile boolean m_isNew
private volatile boolean m_isDirty
private static final char HALF_OF_CHAR
public NTTableEntry(java.lang.String name,
NTEntryType type,
java.lang.Object value)
name - type - value - public NTTableEntry(char id,
java.lang.String name,
char sequenceNumber,
NTEntryType type,
java.lang.Object value)
id - name - sequenceNumber - type - value - public char getId()
public java.lang.Object getValue()
public NTEntryType getType()
public boolean putValue(char newSequenceNumber,
java.lang.Object newValue)
newSequenceNumber - the sequence number of the incoming entrynewValue - the new valuepublic void forcePut(char newSequenceNumber,
java.lang.Object newValue)
newSequenceNumber - newValue - public void forcePut(char newSequenceNumber,
NTEntryType type,
java.lang.Object newValue)
newSequenceNumber - type - newValue - public void makeDirty()
public void makeClean()
public boolean isDirty()
public void sendValue(java.io.DataOutputStream os)
throws java.io.IOException
os - java.io.IOExceptionpublic char getSequenceNumber()
public void setId(char id)
throws java.lang.IllegalStateException
id - the id of the entryjava.lang.IllegalStateException - if the entry already has a known idpublic void clearId()
public void send(NTConnection connection) throws java.io.IOException
java.io.IOExceptionpublic void fireListener(NTEntryStore.TableListenerManager listenerManager)
public java.lang.String toString()
toString in class java.lang.Object