All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.anotheria.util.datatable.DataCell Maven / Gradle / Ivy

There is a newer version: 4.0.0
Show newest version
package net.anotheria.util.datatable;

import net.anotheria.util.Date;
/**
 * A single cell in the table which contains untyped data.
 *
 * @author lrosenberg
 * @version $Id: $Id
 */
public class DataCell {

	/**
	 * The value of the cell.
	 */
	private Object value;

	/**
	 * 

Constructor for DataCell.

*/ public DataCell(){ } /** *

Constructor for DataCell.

* * @param aValue a {@link java.lang.Object} object. */ public DataCell(Object aValue){ value = aValue; } /** *

Setter for the field value.

* * @param aValue a {@link java.lang.Object} object. */ public void setValue(Object aValue) { this.value = aValue; } /** *

Getter for the field value.

* * @return a {@link java.lang.Object} object. */ public Object getValue() { return value; } /** *

getValueAsString.

* * @return a {@link java.lang.String} object. */ public String getValueAsString() { return value.toString(); } /** *

getValueAsInteger.

* * @return a int. */ public int getValueAsInteger() { return value instanceof Integer? (Integer)value : Integer.parseInt(getValueAsString()); } /** *

getValueAsLong.

* * @return a long. */ public long getValueAsLong() { return value instanceof Long? (Long)value : Long.parseLong(getValueAsString()); } /** *

getValueAsFloat.

* * @return a float. */ public float getValueAsFloat() { return value instanceof Float? (Float)value : Float.parseFloat(getValueAsString()); } /** *

getValueAsDouble.

* * @return a double. */ public double getValueAsDouble() { return value instanceof Double? (Double)value : Double.parseDouble(getValueAsString()); } /** *

getValueAsDate.

* * @return a {@link net.anotheria.util.Date} object. */ public Date getValueAsDate() { return value instanceof Date? (Date)value : Date.parse(getValueAsString()); } /** {@inheritDoc} */ @Override public String toString(){ return getValueAsString(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy