Package pl.put.poznan.transformer.logic
Class Cell
- java.lang.Object
-
- pl.put.poznan.transformer.logic.Cell
-
- All Implemented Interfaces:
Comparable<Cell>
public class Cell extends Object implements Comparable<Cell>
Helper class to store a single unit of data. Used to create arrays of data to process. Holds either aDoubleor aString, never both. Also implements theComparableinterface to allow comparing to a differentCell.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Cell c)An override method to compare thisCellto another.booleanequals(Object o)An override for the default equals() method.DoublegetNum()StringgetStr()StringtoString()An override toString() method for printing theCell's value.
-
-
-
Method Detail
-
getNum
public Double getNum()
-
getStr
public String getStr()
-
compareTo
public int compareTo(@NonNull Cell c)An override method to compare thisCellto another.- Specified by:
compareToin interfaceComparable<Cell>- Parameters:
c- the object to be compared.- Returns:
- a positive value if this
Cellis greater than supplied, negative one if lesser and0otherwise.
-
equals
public boolean equals(Object o)
An override for the default equals() method. Allows checking whether two cells are the same.
-
-