nl.knaw.dans.common.dbflib
Class Field

java.lang.Object
  extended by nl.knaw.dans.common.dbflib.Field

public class Field
extends Object

Represents a field description in a table.

Author:
Jan van Mansum, Vesa Ã…kerman

Constructor Summary
Field(String name, Type type)
          Creates a new Field object.
Field(String name, Type type, int length)
          Creates a new Field object.
Field(String name, Type type, int length, int decimalCount)
          Creates a new Field object.
 
Method Summary
 boolean equals(Object other)
           
 int getDecimalCount()
          Returns the decimal count of the field, or -1 if not applicable
 int getLength()
          Returns the length of the field, or -1 if not applicable
 String getName()
          Returns the name of the field.
 Type getType()
          Returns the type of the field
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Field

public Field(String name,
             Type type)
Creates a new Field object. If the specified type has a fixed size and decimal count, they are used. otherwise size is initialized to 1 and decimal count to 0.

Parameters:
name - the name of the field
type - the type of the field

Field

public Field(String name,
             Type type,
             int length)
Creates a new Field object. Decimal count is initialized to 0.

Parameters:
name - the name of the field
type - the type of the field
length - the length of the field

Field

public Field(String name,
             Type type,
             int length,
             int decimalCount)
Creates a new Field object. length and decimalCount do not apply to all field types.

Parameters:
name - name of the field
type - the type of the field
length - the length of the field
decimalCount - the decimal count of the field.
Method Detail

getName

public String getName()
Returns the name of the field.

Returns:
the name of the field

getType

public Type getType()
Returns the type of the field

Returns:
the type of the field

getLength

public int getLength()
Returns the length of the field, or -1 if not applicable

Returns:
the length of the field

getDecimalCount

public int getDecimalCount()
Returns the decimal count of the field, or -1 if not applicable

Returns:
the decimal count of the field

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2009-2012 DANS. All Rights Reserved.