|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjef.dna.fieldsTable.impl.def.FTable
public class FTable
Default implementation class of the FieldsTable
interface.
Field Summary | |
---|---|
protected static Logger |
logger
|
Constructor Summary | |
---|---|
FTable()
Creates a new instance of FTable |
Method Summary | |
---|---|
void |
addAll(FieldsTable ft)
Appends the given FieldsTable to the current one. |
void |
addElement(FieldInfoStructure entry)
Adds the specified FieldInfoStructure at the end of the table. |
void |
addElementAt(FieldInfoStructure entry,
int index,
boolean overwrite)
Adds the specified FieldInfoStructure at the provided position, shifting of
one index any subsequente entry (if exists) iff the overwrite parameter is set
to false , otherwise the current entry at index index will be
overwritten. |
java.lang.Object |
clone()
Clone the current FieldsTable instance. |
void |
fromStream(java.io.DataInputStream dis,
Dna dna,
int fieldsCount)
Reads the table from the given stream. |
FieldInfoStructure |
get(int index)
Get a reference to the entry stored at the provided index. |
Dna |
getDna()
Get the Dna container |
int |
getIndexOf(FieldInfoStructure entry)
Return the index of the provided entry, if exists. |
int |
remove(FieldInfoStructure entry,
boolean compact)
Removes the specified entry, if exists, resizing the table if compact is
true , otherwise the removed entry has to be replaced by null |
FieldInfoStructure |
remove(int index,
boolean compact)
Removes the entry at the specified index, if exists, resizing the table if compact is true , otherwise the removed entry has to be
replaced by null |
void |
setDna(Dna dna)
Set the Dna container |
int |
size()
Returns the number of entries stored by the table |
void |
toStream(java.io.DataOutputStream dos)
Writes the table to the given output stream. |
void |
validate()
This method performs the validation over all the FieldsTable entries. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static Logger logger
Constructor Detail |
---|
public FTable()
Method Detail |
---|
public void addElement(FieldInfoStructure entry)
FieldInfoStructure
at the end of the table.
addElement
in interface FieldsTable
entry
- The entry to be addedpublic void addElementAt(FieldInfoStructure entry, int index, boolean overwrite) throws java.lang.IndexOutOfBoundsException, java.lang.UnsupportedOperationException
FieldInfoStructure
at the provided position, shifting of
one index any subsequente entry (if exists) iff the overwrite
parameter is set
to false
, otherwise the current entry at index index
will be
overwritten.
addElementAt
in interface FieldsTable
entry
- The entry to be addedindex
- The position at which the entry should be placedoverwrite
- Should any existing entry be overwritten?
java.lang.IndexOutOfBoundsException
- Trying to access to an invalid index
java.lang.UnsupportedOperationException
- The method is not supported by the current implementationpublic FieldInfoStructure get(int index) throws java.lang.IndexOutOfBoundsException
get
in interface FieldsTable
index
- The index to access to
java.lang.IndexOutOfBoundsException
- Tying to acces to an invalid indexpublic int getIndexOf(FieldInfoStructure entry) throws FieldInfoStructureNotFoundException, java.lang.UnsupportedOperationException
getIndexOf
in interface FieldsTable
entry
- The entry whose index has to be returned
FieldInfoStructureNotFoundException
- The provided entry is not stored within the current table
java.lang.UnsupportedOperationException
- The method is not supported by the current implementationpublic FieldInfoStructure remove(int index, boolean compact) throws java.lang.IndexOutOfBoundsException, java.lang.UnsupportedOperationException
compact
is true
, otherwise the removed entry has to be
replaced by null
remove
in interface FieldsTable
index
- The index of the entry we want to removecompact
- Has the table to be resized?
java.lang.IndexOutOfBoundsException
- Tying to acces to an invalid index
java.lang.UnsupportedOperationException
- The method is not supported by the current implementationpublic int remove(FieldInfoStructure entry, boolean compact) throws FieldInfoStructureNotFoundException, java.lang.UnsupportedOperationException
compact
is
true
, otherwise the removed entry has to be replaced by null
remove
in interface FieldsTable
entry
- The entry we want to removecompact
- Has the constant pool table to be resized?
FieldInfoStructureNotFoundException
- The provided entry is not stored within the current table
java.lang.UnsupportedOperationException
- The method is not supported by the current implementationpublic int size()
size
in interface FieldsTable
public void addAll(FieldsTable ft)
FieldsTable
to the current one.
addAll
in interface FieldsTable
ft
- The FieldsTable
to be appendedpublic void fromStream(java.io.DataInputStream dis, Dna dna, int fieldsCount) throws MissingDnaContainerException, DnaDeserializationException
fromStream
in interface FieldsTable
dis
- The stream for reading the table fromdna
- The Dna
container instancefieldsCount
- The number of expected fields
MissingDnaContainerException
- This exception is thrown iff no valid Dna
instance has been set
DnaDeserializationException
public void toStream(java.io.DataOutputStream dos) throws DnaSerializationException
toStream
in interface FieldsTable
dos
- The stream for writing the FiledsTable
instance to
DnaSerializationException
public void setDna(Dna dna)
Dna
container
setDna
in interface FieldsTable
dna
- The Dna
containerpublic Dna getDna()
Dna
container
getDna
in interface FieldsTable
Dna
containerpublic void validate() throws FieldInfoValidationException, InfoStructureAttributeOutOfRangeException, MissingDnaContainerException, MissingCPTableException
FieldsTable
FieldsTable
entries.
validate
in interface FieldsTable
FieldInfoValidationException
InfoStructureAttributeOutOfRangeException
MissingDnaContainerException
MissingCPTableException
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
FieldsTable
instance.
clone
in interface FieldsTable
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |