Modifier | Constructor and Description |
---|---|
protected |
TElement()
Prepares a new element.
|
Modifier and Type | Method and Description |
---|---|
void |
addBlock(BlockEntry blockEntry,
Block block)
Adds/replaces a block and block entry to this element.
|
void |
addFunction(java.lang.String functionName,
FunctionEntry entry)
Adds/replaces a block and block entry to this element.
|
boolean |
equals(TElement element)
Compares elements.
|
boolean |
equals(java.lang.Object object) |
void |
fromBytes(byte[] data)
Reads this object's representation from a byte array.
|
Block |
getBlock(BlockEntry blockEntry)
Gets a block using a block entry on this element.
|
java.lang.Iterable<java.util.Map.Entry<BlockEntry,Block>> |
getBlockEntries() |
FunctionEntry |
getFunction(java.lang.String functionName)
Gets a function entry using a function name on this element.
|
java.lang.Iterable<java.util.Map.Entry<java.lang.String,FunctionEntry>> |
getFunctionEntries() |
java.lang.String |
getIdentity()
Gets the identity (primary identifier name).
|
TElement |
getParent()
Gets this object's parent.
|
int |
hashCode() |
boolean |
isArchetype()
Checks if this element is an Archetype.
|
abstract boolean |
isValidEntryType(BlockEntryType type)
Checks if this element handles a particular entry type.
|
void |
readBytes(java.io.InputStream in)
Imports this object from bytes.
|
Block |
resolveBlock(BlockEntry blockEntry)
Resolves a block using a block entry on this element
by going backwards through its lineage.
|
FunctionEntry |
resolveFunction(java.lang.String functionName)
Resolves a function entry using a function name on this element
by going backwards through its lineage.
|
void |
setArchetype(boolean archetype)
Sets if this element is an Archetype.
|
protected void |
setIdentity(java.lang.String identity)
Sets the identity (primary identifier name).
|
protected void |
setIdentityForced(java.lang.String identity)
Sets the identity (primary identifier name) without doing an illegal identity check.
|
void |
setParent(TElement parent)
Sets a parent on this object.
|
byte[] |
toBytes()
Gets this object's representation as bytes.
|
java.lang.String |
toString() |
void |
writeBytes(java.io.OutputStream out)
Exports this object to bytes.
|
public java.lang.String getIdentity()
protected void setIdentity(java.lang.String identity)
identity
- the identity to set.protected void setIdentityForced(java.lang.String identity)
identity
- the identity to set.public abstract boolean isValidEntryType(BlockEntryType type)
type
- the entry type to check.public void addBlock(BlockEntry blockEntry, Block block)
blockEntry
- the block entry to associate with a block.block
- the block to assign.public java.lang.Iterable<java.util.Map.Entry<BlockEntry,Block>> getBlockEntries()
public Block getBlock(BlockEntry blockEntry)
blockEntry
- the block entry to use.public Block resolveBlock(BlockEntry blockEntry)
blockEntry
- the block entry to use.public void addFunction(java.lang.String functionName, FunctionEntry entry)
functionName
- the function name to associate with the table.entry
- the entry to associate.public java.lang.Iterable<java.util.Map.Entry<java.lang.String,FunctionEntry>> getFunctionEntries()
public FunctionEntry getFunction(java.lang.String functionName)
functionName
- the function name to use.public FunctionEntry resolveFunction(java.lang.String functionName)
functionName
- the function name to use.public void setParent(TElement parent)
parent
- the parent object to set.public TElement getParent()
setParent(TElement)
public boolean isArchetype()
public void setArchetype(boolean archetype)
archetype
- true if so, false if not.ModuleException
- if this element cannot be an archetype and archetype
is true
, or
if you attempt to set this to false
on an object that has this already set to true
.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public boolean equals(TElement element)
element
- the other element.public java.lang.String toString()
toString
in class java.lang.Object
public void writeBytes(java.io.OutputStream out) throws java.io.IOException
Saveable
writeBytes
in interface Saveable
out
- the output stream to write to.java.io.IOException
- if a write problem occurs.public void readBytes(java.io.InputStream in) throws java.io.IOException
Saveable
public byte[] toBytes() throws java.io.IOException
Saveable
public void fromBytes(byte[] data) throws java.io.IOException
Saveable