Class Action
- java.lang.Object
-
- cz.cvut.fel.sit.omo.foodchain.operation.OperationBase
-
- cz.cvut.fel.sit.omo.foodchain.operation.Action
-
public class Action extends OperationBase
Operation for processing products in storage
-
-
Field Summary
Fields Modifier and Type Field Description private intdurationprivate Productproductprivate ProductOperationTypetype-
Fields inherited from class cz.cvut.fel.sit.omo.foodchain.operation.OperationBase
LOGGER
-
-
Constructor Summary
Constructors Constructor Description Action(NodeBase node, Product product, ProductOperationType type)
-
Method Summary
Modifier and Type Method Description java.lang.Stringaccept(ReportTextVisitor visitor)private voidendAction()Ends this action and changes products type to available.ProductgetProduct()ProductOperationTypegetType()booleantick()Changes actions duration or ends action.java.lang.StringtoString()-
Methods inherited from class cz.cvut.fel.sit.omo.foodchain.operation.OperationBase
getLastOperation, getNodeCreator, getTimeEnd, getTimeStart, setTimeEnd
-
-
-
-
Field Detail
-
product
private final Product product
-
type
private final ProductOperationType type
-
duration
private int duration
-
-
Constructor Detail
-
Action
public Action(NodeBase node, Product product, ProductOperationType type)
-
-
Method Detail
-
endAction
private void endAction()
Ends this action and changes products type to available.
-
tick
public boolean tick()
Changes actions duration or ends action.- Returns:
- action is in progress
-
getProduct
public Product getProduct()
-
getType
public ProductOperationType getType()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
accept
public java.lang.String accept(ReportTextVisitor visitor)
- Overrides:
acceptin classOperationBase
-
-