xBaseJ
Class DateField

java.lang.Object
  |
  +--xBaseJ.Field
        |
        +--xBaseJ.DateField

public class DateField
extends Field


Constructor Summary
DateField(java.lang.String iName)
          public method for creating a DateField object.
 
Method Summary
 int compareTo(java.util.Calendar compareThis)
          public method for comparing a Java Calendar object.
 int compareTo(DateField compareThis)
          public method for comparing a DateField object.
 java.lang.String get(int field)
          public method for getting individual field values
 java.util.Calendar getCalendar()
          public method for returing the date field in a Java Calendar object.
 char getType()
          return the character 'D' indicating a date field
 void put(java.util.Calendar inValue)
          sets field contents by a Java Calendar object.
 void put(java.util.Date inValue)
          sets field contents by a Java Date object.
 void put(long inValue)
          sets field contents by a long value
 void put(java.lang.String inValue)
          sets field contents by a String parameter.
 void set(int field, int value)
          public method for setting individual field values
 char type()
          Deprecated. use getType
 
Methods inherited from class xBaseJ.Field
decPoint, get, getBytes, getDecimalPositionCount, getLength, getName, length, name
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateField

public DateField(java.lang.String iName)
          throws java.io.IOException,
                 xBaseJException
public method for creating a DateField object. It is not associated with a database but can be when used with some DBF methods.
Parameters:
Name - the name of the field
Throws:
xBaseJException - exception caused in calling methods
java.io.IOException - can not occur but defined for calling methods
See Also:
Field
Method Detail

type

public char type()
Deprecated. use getType

return the character 'D' indicating a date field
Overrides:
type in class Field
Tags copied from class: Field
Returns:
char field type
Throws:
xBaseJException - undefined field type

getType

public char getType()
return the character 'D' indicating a date field
Overrides:
getType in class Field
Tags copied from class: Field
Returns:
char field type
Throws:
xBaseJException - undefined field type

put

public void put(java.lang.String inValue)
         throws xBaseJException
sets field contents by a String parameter.
Overrides:
put in class Field
Parameters:
inValue - String value to store - format CCYYMMDD
Throws:
xBaseJException - most likely a format error

put

public void put(java.util.Date inValue)
         throws xBaseJException
sets field contents by a Java Date object.
Parameters:
inValue - java.util.Date value to store
Throws:
xBaseJException - most likely a format error

put

public void put(java.util.Calendar inValue)
         throws xBaseJException
sets field contents by a Java Calendar object.
Parameters:
inValue - java.util.Calendare value to store
Throws:
xBaseJException - most likely a format error

put

public void put(long inValue)
         throws xBaseJException
sets field contents by a long value
Parameters:
inValue - long value to store - format CCYYMMDD
Throws:
xBaseJException - most likely a format error

compareTo

public int compareTo(DateField compareThis)
public method for comparing a DateField object.
Parameters:
compareThis - the other DateField object to compare

compareTo

public int compareTo(java.util.Calendar compareThis)
              throws xBaseJException
public method for comparing a Java Calendar object.
Parameters:
compareThis - the Date object to compare
Throws:
xBaseJException - exception caused in calling methods

getCalendar

public java.util.Calendar getCalendar()
                               throws xBaseJException
public method for returing the date field in a Java Calendar object.
Throws:
xBaseJException - exception caused in calling methods

get

public java.lang.String get(int field)
                     throws xBaseJException
public method for getting individual field values
Parameters:
field - id, use Calendar.YEAR, Calendar.MONTh, Calendar.DAY_OF_MONTH
Throws:
xBaseJException - exception caused in calling methods

set

public void set(int field,
                int value)
         throws xBaseJException
public method for setting individual field values
Parameters:
field - use Calendar.YEAR, Calendar.MONTh, Calendar.DAY_OF_MONTH
value - - int value to set field
Throws:
xBaseJException - exception caused in calling methods