public class Cell
extends java.lang.Object
Constructor and Description |
---|
Cell(Cell cell)
Constructor that creates a cell by copying the given Cell
|
Cell(int cost)
Constructor that creates a cell without any OperationSequence but with a
cost
|
Cell(int cost,
java.util.ArrayList<OperationSequence> sequences)
Constructor that creates a cell with OperationSequences but with a cost
|
Cell(int cost,
java.util.HashSet<OperationSequence> sequences)
Constructor that creates a cell with OperationSequences but with a cost
|
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(Operation o)
Adds the Operation given at the end of every OperationSequence of the
Result.
|
void |
addToSequences(OperationSequence os)
Adds the OperationSequence given at the end of every OperationSequence of
the Result.
|
Cell |
clone() |
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 |
toFlatString() |
java.lang.String |
toString() |
public Cell(Cell cell)
cell
- Cell to copypublic Cell(int cost)
cost
- Cost of the cellpublic Cell(int cost, java.util.ArrayList<OperationSequence> sequences)
cost
- Cost of the cellsequences
- ArrayList of OperationSequencespublic Cell(int cost, java.util.HashSet<OperationSequence> sequences)
cost
- Cost of the cellsequences
- 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 addToSequences(Operation o)
o
- Operation 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 Cell clone()
clone
in class java.lang.Object
public java.lang.String toFlatString()