gate.db
Class Field

java.lang.Object
  |
  +--gate.db.Field

public class Field
extends Object

This class is used in defining databases structure. More precisely, this class defines a column in a database table.


Field Summary
 String name
           
 boolean notNull
           
 boolean primaryKey
           
 int scale
           
 int size
           
 String type
           
 
Constructor Summary
Field(String name, String type, int size, int scale, boolean notNull, boolean primaryKey)
          Constructs a instance of Field.
 
Method Summary
 boolean equals(Object obj)
          Checks this object for "equality" whith annother object of type Field.
 String toString()
          Returns a String representation of this object.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public String name

type

public String type

size

public int size

scale

public int scale

notNull

public boolean notNull

primaryKey

public boolean primaryKey
Constructor Detail

Field

public Field(String name,
             String type,
             int size,
             int scale,
             boolean notNull,
             boolean primaryKey)
Constructs a instance of Field.
Parameters:
name - a value of type 'String', the name of the column.
type - a value of type 'String', the SQL type of the column.
size - a value of type 'int', the size (precision) of the column
scale - a value of type 'int', the scale (number of decimal places) of the column.
notNull - a value of type 'boolean', is this column NOT NULLABLE?
primaryKey - a value of type 'boolean', is this column a member of the primary key?
Method Detail

toString

public String toString()
Returns a String representation of this object.
Overrides:
toString in class Object
Returns:
a value of type 'String'

equals

public boolean equals(Object obj)
Checks this object for "equality" whith annother object of type Field. NOTE: this is NOT an equality test. This method return true even if the 'size' field of the given object is larger than the 'size' field of this object. This was necessary because this method is actually used while testing a database for compliance with a given structure (obviously a larger size does not stop table from being compliant with the requested structure).
Overrides:
equals in class Object
Parameters:
obj - a value of type 'Object'
Returns:
a value of type 'boolean'