|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjef.dna.attributesTable.impl.def.ATable
public class ATable
Default implementation of the AttributesTable
interface.
Field Summary | |
---|---|
protected static Logger |
logger
|
Constructor Summary | |
---|---|
ATable()
Creates a new instance of ATable |
Method Summary | |
---|---|
void |
addAll(AttributesTable at)
Appends the given AttributesTable to the current one. |
void |
addElement(Attribute entry)
Adds the specified Attribute at the end of the table. |
void |
addElementAt(Attribute entry,
int index,
boolean overwrite)
Adds the specified Attribute 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 AttributesTable instance. |
void |
fromStream(java.io.DataInputStream dis,
Dna dna,
int dim)
Reads the table from the given stream. |
Attribute |
get(int index)
Get a reference to the entry stored at the provided index. |
Dna |
getDna()
Get the Dna container |
int |
getIndexOf(Attribute entry)
Return the index of the provided entry, if exists. |
int |
remove(Attribute 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 |
Attribute |
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()
Validates all the AttributesTable 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 ATable()
Method Detail |
---|
public void addAll(AttributesTable at)
AttributesTable
to the current one.
addAll
in interface AttributesTable
at
- The AttributesTable
to be appendedpublic void addElement(Attribute entry)
Attribute
at the end of the table.
addElement
in interface AttributesTable
entry
- The entry to be addedpublic void addElementAt(Attribute entry, int index, boolean overwrite) throws java.lang.IndexOutOfBoundsException, java.lang.UnsupportedOperationException
Attribute
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 AttributesTable
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 void fromStream(java.io.DataInputStream dis, Dna dna, int dim) throws MissingDnaContainerException, DnaDeserializationException
fromStream
in interface AttributesTable
dis
- The stream for reading the table fromdna
- The Dna
container instancedim
- The number of expected attributes
MissingDnaContainerException
- This exception is thrown iff no valid Dna
instance has been set
DnaDeserializationException
public Attribute get(int index) throws java.lang.IndexOutOfBoundsException
get
in interface AttributesTable
index
- The index to access to
java.lang.IndexOutOfBoundsException
- Tying to acces to an invalid indexpublic Dna getDna()
Dna
container
getDna
in interface AttributesTable
Dna
containerpublic int getIndexOf(Attribute entry) throws AttributeNotFoundException, java.lang.UnsupportedOperationException
getIndexOf
in interface AttributesTable
entry
- The entry whose index has to be returned
AttributeNotFoundException
- The provided entry is not stored within the current table
java.lang.UnsupportedOperationException
- The method is not supported by the current implementationpublic Attribute 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 AttributesTable
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(Attribute entry, boolean compact) throws AttributeNotFoundException, java.lang.UnsupportedOperationException
compact
is
true
, otherwise the removed entry has to be replaced by null
remove
in interface AttributesTable
entry
- The entry we want to removecompact
- Has the constant pool table to be resized?
AttributeNotFoundException
- The provided entry is not stored within the current table
java.lang.UnsupportedOperationException
- The method is not supported by the current implementationpublic void setDna(Dna dna)
Dna
container
setDna
in interface AttributesTable
dna
- The Dna
containerpublic int size()
size
in interface AttributesTable
public void toStream(java.io.DataOutputStream dos) throws DnaSerializationException
toStream
in interface AttributesTable
dos
- The stream for writing the AttributesTable
instance to
DnaSerializationException
public void validate() throws AttributeValidationException, AttributeOutOfRangeException, MissingDnaContainerException, MissingCPTableException
AttributesTable
AttributesTable
entries.
validate
in interface AttributesTable
AttributeValidationException
AttributeOutOfRangeException
MissingDnaContainerException
MissingCPTableException
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
AttributesTable
instance. This cloning does not
modify the reference to the containing Dna
instance.
clone
in interface AttributesTable
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 |