Package at.jku.ssw.fp.sect05_2.workflow
Class Ingr
- java.lang.Object
-
- at.jku.ssw.fp.sect05_2.workflow.Stuff
-
- at.jku.ssw.fp.sect05_2.workflow.Ingr
-
public class Ingr extends Stuff
Basic ingredients for a product produced by a workflow.- Author:
- Herbert Praehofer
-
-
Field Summary
Fields Modifier and Type Field Description private double
amount
The amount of the ingredient.private String
name
The name of the ingredient.-
Fields inherited from class at.jku.ssw.fp.sect05_2.workflow.Stuff
treatments
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
double
getAmount()
Gets the amount of this ingredient.String
getName()
Gets the name of this ingredient.int
hashCode()
static Ingr
of(String name, double amount)
Creates an ingredient with name and amount.String
toString()
-
-
-
Field Detail
-
name
private final String name
The name of the ingredient.
-
amount
private final double amount
The amount of the ingredient.
-
-
Constructor Detail
-
Ingr
private Ingr(String name, double amount)
Private constructor initializing name and amount of the ingredient.- Parameters:
name
- the name of the ingredientamount
- the amount of the ingredient
-
-
Method Detail
-
of
public static Ingr of(String name, double amount)
Creates an ingredient with name and amount.- Parameters:
name
- the nameamount
- the amount- Returns:
- the ingredient
-
getName
public String getName()
Gets the name of this ingredient.- Returns:
- the name
-
getAmount
public double getAmount()
Gets the amount of this ingredient.- Returns:
- the amount
-
-