package edu.stanford.rt.datatype;
import java.util.Date;
import java.text.DateFormat;
/**
* @author Ninghui Li, Sandra Qiu
*
* Implementation of TimeValue
in RTML
*
*/
public class TimeValue implements DataValue
{
// Which XML Schema datetype is for this TimeValue?
private String type;
// The corresponding Java Date object for this TimeValue.
private Date value;
/**
* Constructor for TimeValue.
*/
public TimeValue(String type, Date value)
{
this.type = type;
this.value = value;
}
/**
* Method getValue.
* @return Date
*/
public Date getValue()
{
return value;
}
/**
* Method getTypeName.
* @return String
*/
public String getType()
{
return type;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
public String toString()
{
return DateFormat.getDateInstance().format(value);
}
}