public class Warrior
extends java.lang.Object
RedCodeArrayList,
Instruction| Constructor and Description |
|---|
Warrior() |
| Modifier and Type | Method and Description |
|---|---|
void |
addMeta(java.lang.String tag,
java.lang.String value)
The function addMeta() adds a new tag-value-pare to the meta-data of the
Warrior.
|
boolean |
containsMetaTag(java.lang.String tag)
Tests if a tag String exists within all tags of a Warrior.
|
protected Instruction |
getInstruction(int id)
Gets the Instruction at the passed id.
|
protected RedCodeArrayList<Instruction> |
getInstructionSet()
Gets the warriors InstructionSet
|
int |
getInstructionSize()
Gets the size of the warriors InstructionSet
|
java.lang.String |
getMeta(int id)
Gets metaValue of the given id.
|
java.lang.String |
getMetaByTag(java.lang.String tag)
Gets the corresponding metaValue of the passed tag.
|
int |
getMetaSize()
Gets the size of the meta-data-pares.
|
java.lang.String |
getMetaTag(int id)
Gets metaTag of the given id.
|
void |
removeMetaById(int id)
Deletes the meta-pare of the passed id.
|
void |
removeMetaByTag(java.lang.String tag)
Deletes the meta-pare of the passed tag.
|
void |
renameTag(java.lang.String oldTagName,
java.lang.String newTagName)
Replaces the oldTagName with the newTagName.
|
void |
setMetaByTag(java.lang.String tag,
java.lang.String value)
The function setMetaByTag() changes the value corresponding the passed
tag.
|
public void addMeta(java.lang.String tag,
java.lang.String value)
tag - is a reference to the corresponding value.value - is the main content to be found.public int getMetaSize()
public java.lang.String getMetaByTag(java.lang.String tag)
tag - should match an existing, previously stored tag and is used to
reference the value one is seeking.public boolean containsMetaTag(java.lang.String tag)
tag - a String Value which may or may not exist within the Warrior
tags.public java.lang.String getMetaTag(int id)
throws java.io.IOException
id - must be within the range of possible Indices.java.io.IOException - if tag id is out of range.public java.lang.String getMeta(int id)
throws java.io.IOException
id - must be within the range of possible Indices.java.io.IOException - if value id is out of range.public void renameTag(java.lang.String oldTagName,
java.lang.String newTagName)
throws java.io.IOException
oldTagName - must match an existing, previously stored tag.newTagName - java.io.IOException - if no matching tag is found.public void removeMetaByTag(java.lang.String tag)
throws java.io.IOException
tag - must match an existing, previously stored tag and is used to
reference the value one is seeking.java.io.IOException - if no matching tag is found.public void removeMetaById(int id)
throws java.io.IOException
id - must be within the range of possible Indices.java.io.IOException - if value id is out of range.public void setMetaByTag(java.lang.String tag,
java.lang.String value)
throws java.io.IOException
tag - is a reference to the corresponding value.value - is the main content to be found.java.io.IOException - if no matching tag is found.protected RedCodeArrayList<Instruction> getInstructionSet()
public int getInstructionSize()
protected Instruction getInstruction(int id) throws java.io.IOException
id - must be within the range of possible Indices.java.io.IOException - if tag id is out of range.