KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > olap > model > impl > CellImpl


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.jpivot.olap.model.impl;
14
15 import com.tonbeller.jpivot.olap.model.Cell;
16 import com.tonbeller.jpivot.olap.model.NumberFormat;
17 import com.tonbeller.jpivot.olap.model.Visitor;
18
19 /**
20  * Created on 11.10.2002
21  *
22  * @author av
23  */

24 public class CellImpl extends PropertyHolderImpl implements Cell {
25   String JavaDoc formattedValue;
26   Object JavaDoc value;
27
28   /**
29    * Returns the formattedValue.
30    * @return String
31    */

32   public String JavaDoc getFormattedValue() {
33     return formattedValue;
34   }
35
36   /**
37    * Returns the value.
38    * @return Object
39    */

40   public Object JavaDoc getValue() {
41     return value;
42   }
43
44   /**
45    * Sets the formattedValue.
46    * @param formattedValue The formattedValue to set
47    */

48   public void setFormattedValue(String JavaDoc formattedValue) {
49     this.formattedValue = formattedValue;
50   }
51
52   /**
53    * Sets the value.
54    * @param value The value to set
55    */

56   public void setValue(Object JavaDoc value) {
57     this.value = value;
58   }
59
60   public boolean isNull() {
61     return value == null;
62   }
63
64   public void accept(Visitor visitor) {
65     visitor.visitCell(this);
66   }
67   
68   public Object JavaDoc getRootDecoree() {
69     return this;
70   }
71
72   public NumberFormat getFormat() {
73     if (value instanceof Number JavaDoc)
74       return new NumberFormatImpl();
75     return null;
76   }
77
78 }
79
Popular Tags