summaryrefslogtreecommitdiff
path: root/src/com/google/wireless/gdata/spreadsheets/data/CellEntry.java
blob: 88fb6b60f53869fd4c6fa3b7175b157e6dadf090 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// Copyright 2007 The Android Open Source Project
package com.google.wireless.gdata.spreadsheets.data;

import com.google.wireless.gdata.data.Entry;

/**
 * Represents an entry in a GData Spreadsheets Cell-based feed.
 */
public class CellEntry extends Entry {
    /** The spreadsheet column of the cell. */
    private int col = -1;

    /** The cell entry's inputValue attribute */
    private String inputValue = null;

    /** The cell entry's numericValue attribute */
    private String numericValue = null;

    /** The spreadsheet row of the cell */
    private int row = -1;

    /** The cell entry's text sub-element */
    private String value = null;

    /** Default constructor. */
    public CellEntry() {
        super();
    }
    
    /**
     * Fetches the cell's spreadsheet column.
     * 
     * @return the cell's spreadsheet column
     */
    public int getCol() {
        return col;
    }

    /**
     * Fetches the cell's inputValue attribute, which is the actual user input
     * rather (such as a formula) than computed value of the cell.
     * 
     * @return the cell's inputValue
     */
    public String getInputValue() {
        return inputValue;
    }

    /**
     * Fetches the cell's numericValue attribute, which is a decimal
     * representation.
     * 
     * @return the cell's numericValue
     */
    public String getNumericValue() {
        return numericValue;
    }

    /**
     * Fetches the cell's spreadsheet row.
     * 
     * @return the cell's spreadsheet row
     */
    public int getRow() {
        return row;
    }

    /**
     * Fetches the cell's contents, after any computation. For example, if the
     * cell actually contains a formula, this will return the formula's computed
     * value.
     * 
     * @return the computed value of the cell
     */
    public String getValue() {
        return value;
    }

    /**
     * Indicates whether the cell's contents are numeric.
     * 
     * @return true if the contents are numeric, or false if not
     */
    public boolean hasNumericValue() {
        return numericValue != null;
    }

    /**
     * Sets the cell's spreadsheet column.
     * 
     * @param col the new spreadsheet column of the cell
     */
    public void setCol(int col) {
        this.col = col;
    }

    /**
     * Sets the cell's actual contents (such as a formula, or a raw value.)
     * 
     * @param inputValue the new inputValue of the cell
     */
    public void setInputValue(String inputValue) {
        this.inputValue = inputValue;
    }

    /**
     * Sets the cell's numeric value. This can be different from the actual
     * value; for instance, the actual value may be a thousands-delimited pretty
     * string, while the numeric value could be the raw decimal.
     * 
     * @param numericValue the cell's new numericValue
     */
    public void setNumericValue(String numericValue) {
        this.numericValue = numericValue;
    }

    /**
     * Sets the cell's spreadsheet row.
     * 
     * @param row the new spreadsheet row of the cell
     */
    public void setRow(int row) {
        this.row = row;
    }

    /**
     * Sets the cell's computed value.
     * 
     * @param value the new value of the cell
     */
    public void setValue(String value) {
        this.value = value;
    }
}