public class AddNodeOperation extends EditOperation
Operation.OperationType
Modifier and Type | Field and Description |
---|---|
static int |
cost |
Constructor and Description |
---|
AddNodeOperation(Address address,
java.lang.Character header)
Constructor of the operation AddNodeOperation
|
Modifier and Type | Method and Description |
---|---|
static void |
changeOperationCost(int cost) |
Operation |
clone()
Creates a copy of the Operation
|
boolean |
equals(java.lang.Object o)
Tests if the object given is from the same type and has the same
hashCode, this means they have the same values for attributes
|
int |
getCost()
Calculates the cost of the Operation
|
int |
getCost(Tree tree)
Calculates the cost of the Operation on the given Tree
|
int |
hashCode()
Returns an unique hashCode depending on the values of the attributes
|
void |
make(Tree tree)
Makes the Operation on the given Tree
|
java.lang.String |
toString()
Converts the operation to a string like OperationName[attributes]
|
org.jdom.Element |
toXmlElement() |
org.jdom.Element |
toXmlElement(VocabTranslator vt) |
isAbstract, isAbstractStrict
addAddressPrefix, getAddress, getOperationString, getOperationType, setAddress, toCompleteString
public AddNodeOperation(Address address, java.lang.Character header) throws headerNodeException
address
- The Address of the Node to relabelheader
- The header to use to relabel the NodeheaderNodeException
- Throws this exception is the header of the new node is ""public int getCost()
getCost
in class EditOperation
public int getCost(Tree tree)
Operation
public void make(Tree tree) throws addNodeException, badAddressException, headerNodeException
Operation
make
in class Operation
tree
- Tree where the Operation should be doneaddNodeException
- Throws this Exception if the Operation implicates the
creation of a Node that can't be donebadAddressException
- Throws this Exception if there is an error while creating new
AddressesheaderNodeException
- Throws this exception is the header of the new node is ""public java.lang.String toString()
Operation
public Operation clone()
Operation
public boolean equals(java.lang.Object o)
Operation
public int hashCode()
Operation
public org.jdom.Element toXmlElement()
toXmlElement
in class Operation
public org.jdom.Element toXmlElement(VocabTranslator vt)
toXmlElement
in class Operation
public static void changeOperationCost(int cost)