public abstract class Operation
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Operation.OperationType |
Constructor and Description |
---|
Operation() |
Modifier and Type | Method and Description |
---|---|
void |
addAddressPrefix(Address prefix)
Puts the prefix given at the begin of the Address of the Operation
|
abstract Operation |
clone()
Creates a copy of the Operation
|
abstract 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
|
Address |
getAddress()
Returns a copy of the Address where the Operation should be made
|
abstract int |
getCost(Tree tree)
Calculates the cost of the Operation on the given Tree
|
java.lang.String |
getOperationString()
Gives the label of the Operation
|
Operation.OperationType |
getOperationType()
Gives the label of the Operation
|
abstract int |
hashCode()
Returns an unique hashCode depending on the values of the attributes
|
abstract boolean |
isAbstract()
Tests if the Operation is an UpdateOperation or an EditOperation.
|
abstract boolean |
isAbstractStrict()
Tests if the Operation is an Abstract Strict Operation, meaning a
compilation of multiple UpdateOperation that have the same cost but not
the same result
|
abstract void |
make(Tree tree)
Makes the Operation on the given Tree
|
void |
setAddress(Address address)
Changes the Address of the Operation with the one given
|
java.lang.String |
toCompleteString()
Converts the operation to a string like OperationName[attributes]
|
abstract java.lang.String |
toString()
Converts the operation to a string like OperationName[attributes]
|
abstract org.jdom.Element |
toXmlElement() |
abstract org.jdom.Element |
toXmlElement(VocabTranslator vt) |
public java.lang.String getOperationString()
public Operation.OperationType getOperationType()
public Address getAddress()
public void setAddress(Address address)
address
- Address to usepublic void addAddressPrefix(Address prefix)
prefix
- new begin of the Address of the Operationpublic abstract int getCost(Tree tree) throws badOperationException, noNodeException
tree
- Tree where the Operation should be madebadOperationException
- Throws this Exception if the Operation isn't oknoNodeException
- Throws this exception if the Operation contains an Address
that doesn't exist in the given Treepublic abstract void make(Tree tree) throws addNodeException, noNodeException, removeNodeException, badAddressException, headerNodeException, abstractOperationException
tree
- Tree where the Operation should be doneaddNodeException
- Throws this Exception if the Operation implicates the
creation of a Node that can't 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
AddressesheaderNodeException
- Throws this exception is the header of the new node is ""abstractOperationException
- Throws this exception if the Operation is an Abstract
operation like AddMinimalTreeOperationpublic abstract java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toCompleteString()
public abstract Operation clone()
clone
in class java.lang.Object
public abstract boolean isAbstract()
public abstract boolean isAbstractStrict()
public abstract boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public abstract int hashCode()
hashCode
in class java.lang.Object
public abstract org.jdom.Element toXmlElement()
public abstract org.jdom.Element toXmlElement(VocabTranslator vt)