olg.csv.base
Class Cell

java.lang.Object
  extended by olg.csv.base.Cell

public class Cell
extends Object

Cell in a spreadsheet. Impoverished model to be conformed with use of CSV.

Author:
Olivier Godineau
See Also:
Row

Constructor Summary
Cell(int num, String value)
           
Cell(String num, String value)
           
 
Method Summary
static String defaultCellName(String num)
          Returns the default cell name.
 boolean equals(Object obj)
           
static int fromSheetCellNumber(String num)
          Interprets the String in argument as a cell number.
 int getNum()
          Column number of this cell among parent row cells.
 String getSheetFormatNumber()
          Returns the column number of this cell in a spreadsheet format ( A for 0, AA for 26, ...).
static String getSheetFormatNumber(int num)
          Returns a num cell in a spreadsheet cell number format.
 String getValue()
          Returns the value of this cell.
 int hashCode()
           
 boolean isEmpty()
          Returns true if this cell represents an empty cell.
 String toString()
          Returns the couple (num: value) that this cell represents.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cell

public Cell(int num,
            String value)
Parameters:
num - column number. Must be >= 0.
value - cell value

Cell

public Cell(String num,
            String value)
Parameters:
num - column number
value - cell value
Method Detail

fromSheetCellNumber

public static int fromSheetCellNumber(String num)
Interprets the String in argument as a cell number. Two ways :

Parameters:
num - the num cell. Must match one of the two cases see above.
Returns:
the cell num as integer.

getSheetFormatNumber

public static String getSheetFormatNumber(int num)
Returns a num cell in a spreadsheet cell number format.

Parameters:
num - . Must be >=0.
Returns:
the num as a spreadsheet cell number

defaultCellName

public static String defaultCellName(String num)
Returns the default cell name.

Parameters:
num - the num of a cell.
Returns:
the default cell name.

getNum

public int getNum()
Column number of this cell among parent row cells.

Returns:
the cell num.

getValue

public String getValue()
Returns the value of this cell.

Returns:
null if this cell is empty.

isEmpty

public boolean isEmpty()
Returns true if this cell represents an empty cell.

Returns:
true if cell is empty.

getSheetFormatNumber

public String getSheetFormatNumber()
Returns the column number of this cell in a spreadsheet format ( A for 0, AA for 26, ...).

Returns:
the column number in a sheet format.

toString

public String toString()
Returns the couple (num: value) that this cell represents.

Overrides:
toString in class Object
Returns:
the cell string representation.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2014. All rights reserved.