public class AddMinimalTreeOperation extends AbstractUpdateOperation
Operation.OperationType
Constructor and Description |
---|
AddMinimalTreeOperation(Address address,
java.lang.Character header,
TreeSchema ts)
Constructor of the operations ReplaceTreeOperation
|
Modifier and Type | Method and Description |
---|---|
java.util.Collection<OperationSequence> |
abstractionStrictToAbstractOperationSequences()
Generates a list of OperationSequence that can't contain any Operation
that is Abstract Strict
|
java.util.Collection<OperationSequence> |
abstractionToOperationSequences(Tree t)
Generates a list of OperationSequence that can't contain any Operation
that is Abstract
|
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() |
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) |
isAbstractStrict
isAbstract
addAddressPrefix, getAddress, getOperationString, getOperationType, setAddress, toCompleteString
public AddMinimalTreeOperation(Address address, java.lang.Character header, TreeSchema ts) throws noMinimalTreeException
address
- Address of the Node that should be replacedheader
- Character of the root of the Tree to createts
- TreeSchema to use to create the Minimal TreenoMinimalTreeException
- Throws this exception if there isn't any minimal tree for
this headerpublic java.util.Collection<OperationSequence> abstractionToOperationSequences(Tree t) throws badOperationException, badAddressException, noNodeException, headerNodeException, addNodeException, removeNodeException, abstractOperationException
UpdateOperation
abstractionToOperationSequences
in class UpdateOperation
addNodeException
removeNodeException
abstractOperationException
badOperationException
badAddressException
noNodeException
headerNodeException
public java.util.Collection<OperationSequence> abstractionStrictToAbstractOperationSequences()
AbstractUpdateOperation
abstractionStrictToAbstractOperationSequences
in class AbstractUpdateOperation
public void make(Tree tree) throws abstractOperationException
Operation
make
in class Operation
tree
- Tree where the Operation should be doneabstractOperationException
- Throws this exception if the Operation is an Abstract
operation like AddMinimalTreeOperationpublic int getCost(Tree tree)
Operation
public int getCost()
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