public class RemoveNodeOperation extends EditOperation
Operation.OperationType
Modifier and Type | Field and Description |
---|---|
static int |
cost |
Constructor and Description |
---|
RemoveNodeOperation(Address address)
Constructor of the operation RemoveNodeOperation
|
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 RemoveNodeOperation(Address address)
address
- Address of the Node that has to be removedpublic int getCost()
getCost
in class EditOperation
public int getCost(Tree tree)
Operation
public void make(Tree tree) throws noNodeException, removeNodeException, badAddressException
Operation
make
in class Operation
tree
- Tree where the Operation should be donenoNodeException
- Throws this Exception if the Operation implicates an access
to a Node that doesn't existremoveNodeException
- Throws this Exception if the Operation tries to remove a Node
that isn't a LeafbadAddressException
- Throws this Exception if there is an error while creating new
Addressespublic 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)