public class Result
extends java.lang.Object
Constructor and Description |
---|
Result(Cell c)
Constructor that creates a Result from a Matrix cell
|
Result(int cost)
Constructor that creates a result without any OperationSequence but with
a cost
|
Result(int cost,
java.util.Collection<OperationSequence> sequences)
Constructor that creates a result with OperationSequences but with a cost
|
Result(int cost,
java.util.HashSet<OperationSequence> sequences)
Constructor that creates a result with OperationSequences but with a cost
|
Result(Result result)
Constructor that creates a result by copying the given Result
|
Modifier and Type | Method and Description |
---|---|
void |
addAddressPrefix(Address reference)
Changes the Address of every OperationSequence by adding the given
Address at the begin of their Addresses
|
void |
addSequence(OperationSequence sequence)
Adds an OperationSequence
|
void |
addSequences(java.util.Collection<OperationSequence> sequences)
Adds a collection of OperationSequence to the result
|
void |
addToSequences(OperationSequence os)
Adds the OperationSequence given at the end of every OperationSequence of
the Result.
|
Result |
clone() |
boolean |
equals(java.lang.Object o) |
int |
getCost()
Returns the cost to make the operation sequences
|
OperationSequence |
getSequence(int position)
Returns the OperationSequence at position / null if there isn't any
|
java.util.Collection<OperationSequence> |
getSequences()
Returns the Collection of OperationSequence
|
Tree |
make(Tree t)
Use the given Tree to make the Operations of the first OperationSequence
and returns the modified Tree.
|
void |
setCost(int cost)
Changes the current cost with the cost given
|
java.lang.String |
toCompleteString() |
java.lang.String |
toString() |
public Result(Result result)
result
- Result to copypublic Result(Cell c)
c
- public Result(int cost)
cost
- Cost of the resultpublic Result(int cost, java.util.Collection<OperationSequence> sequences)
cost
- Cost of the resultsequences
- ArrayList of OperationSequencespublic Result(int cost, java.util.HashSet<OperationSequence> sequences)
cost
- Cost of the resultsequences
- ArrayList of OperationSequencespublic void addSequence(OperationSequence sequence)
sequence
- OperationsSquence to addpublic void addSequences(java.util.Collection<OperationSequence> sequences)
sequences
- OperationSequences to addpublic int getCost()
public void setCost(int cost)
cost
- Cost to usepublic OperationSequence getSequence(int position)
position
- Position of the OperationSequence to returnpublic java.util.Collection<OperationSequence> getSequences()
public Tree make(Tree t) throws addNodeException, noNodeException, removeNodeException, badAddressException, headerNodeException, abstractOperationException
t
- Tree to use to make every OperationsaddNodeException
- Throws this Exception if there is an error while trying to
add a NodenoNodeException
- Throws this Exception if an Operation tries to access to a
Node that doesn't existremoveNodeException
- Throws this Exception if there is an error while trying to
remove a NodebadAddressException
- 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 is an abstract operation in the
sequence like AddMinimalTreeOperationpublic void addToSequences(OperationSequence os)
os
- OperationSequence to add at the end of every OperationSequencepublic void addAddressPrefix(Address reference)
reference
- Address to add at the begin of every Operation's Addresspublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toCompleteString()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public Result clone()
clone
in class java.lang.Object