public class ElementHolder
extends java.lang.Object
Constructor and Description |
---|
ElementHolder(InstanceElement[] instances)
Create a new ElementHolder from an array of instance elements.
|
ElementHolder(NameValueUnit[][] inNvu,
java.util.Hashtable<java.lang.String,java.lang.String> baseAttributes)
Create a new ElementHolder from a NameValueUnit[][].
|
Modifier and Type | Method and Description |
---|---|
ElementHolder |
clone() |
void |
compress()
Remove all null entries from nvu[][].
|
void |
destroy() |
void |
dump(java.lang.String dumpFilePath,
java.lang.String filename,
java.lang.String description)
Write the dump of the ElementHolders content to a file
|
java.lang.String |
getBaseAttribute(java.lang.String baName)
Get the name of a base attribute by its base name
|
java.util.Hashtable<java.lang.String,java.lang.String> |
getBaseAttributes()
Get a Hashtable containing the names of all base attributes
|
long |
getHighestId() |
java.util.Hashtable<java.lang.Long,java.lang.Integer> |
getIdIndex()
Get the id index
|
java.util.Hashtable<java.lang.Long,java.lang.String> |
getIdNameMap() |
java.util.Hashtable<java.lang.String,java.lang.Integer> |
getNameIndex()
Get the Name index
|
NameValueUnit[][] |
getNvu()
Get the instances and attributes as NameValueUnit[][]
|
boolean |
hasValues() |
void |
hasValues(boolean hasValues) |
void |
renameInstance(java.lang.String oldName,
java.lang.String newName)
Rename an instance in the NameValueUnit[][] and update the indices in the ElementHolder
|
void |
setBaseAttribute(java.lang.String baName,
java.lang.String attrName)
Set the name of a base attribute by its base name
|
void |
setBaseAttributes(java.util.Hashtable<java.lang.String,java.lang.String> baseAttributes)
Set the base attributes from a Hashtable.
|
void |
setNvu(NameValueUnit[][] nvu)
Update the instances and attributes and compress (remove the null values)
|
public ElementHolder(InstanceElement[] instances) throws AoException
instances
- Array of instance elements to create the ElementHolder from.AoException
public ElementHolder(NameValueUnit[][] inNvu, java.util.Hashtable<java.lang.String,java.lang.String> baseAttributes) throws ExecutableException
inNvu
- The NameValueUnit[][] holding the instances ant their attributes.baseAttributes
- The Hashtable holding the base attributes.ExecutableException
- if base attribute name or id is missing.public ElementHolder clone()
clone
in class java.lang.Object
public long getHighestId()
public void compress()
public NameValueUnit[][] getNvu()
public void setNvu(NameValueUnit[][] nvu)
nvu
- the new NameValueUnit[][]public java.util.Hashtable<java.lang.String,java.lang.Integer> getNameIndex()
public java.util.Hashtable<java.lang.Long,java.lang.Integer> getIdIndex()
public java.util.Hashtable<java.lang.String,java.lang.String> getBaseAttributes()
public void setBaseAttributes(java.util.Hashtable<java.lang.String,java.lang.String> baseAttributes) throws ExecutableException
baseAttributes
- The Hashtable containing the base attributesExecutableException
- If name for base attribute id or name is not in the Hashtablepublic java.lang.String getBaseAttribute(java.lang.String baName)
baName
- The base attribute namepublic void setBaseAttribute(java.lang.String baName, java.lang.String attrName)
baName
- The base attribute nameattrName
- The attribute namepublic void dump(java.lang.String dumpFilePath, java.lang.String filename, java.lang.String description) throws ExecutableException
dumpFilePath
- The path where the file is created. If the path is null nothing is written.filename
- The file the dump is written to. If the filename is null stdout is used.description
- An additional header that is written to the fileExecutableException
- if an IOException occourspublic void renameInstance(java.lang.String oldName, java.lang.String newName) throws ExecutableException
oldName
- The old namenewName
- The new nameExecutableException
public void destroy()
public boolean hasValues()
public void hasValues(boolean hasValues)
public java.util.Hashtable<java.lang.Long,java.lang.String> getIdNameMap()