org.mmbase.bridge.implementation
Class BasicField

java.lang.Object
  |
  +--org.mmbase.bridge.implementation.BasicField
All Implemented Interfaces:
java.lang.Comparable, Field

public class BasicField
extends java.lang.Object
implements Field, java.lang.Comparable

Version:
$Id: BasicField.java,v 1.11 2002/10/24 12:56:07 pierre Exp $
Author:
Pierre van Rooden

Fields inherited from interface org.mmbase.bridge.Field
STATE_PERSISTENT, STATE_SYSTEM, STATE_UNKNOWN, STATE_VIRTUAL, TYPE_BYTE, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INTEGER, TYPE_LONG, TYPE_NODE, TYPE_STRING, TYPE_UNKNOWN, TYPE_XML
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this field to the passed object.
 boolean equals(java.lang.Object o)
          Compares this field to the passed object, and returns true if they are equal.
 java.lang.String getDescription()
          Returns the description for this field.
 java.lang.String getGUIName()
          Returns the GUI name for this field.
 java.lang.String getGUIType()
          Returns the GUI name for the data type this field contains.
 int getMaxLength()
          Returns the maximum length of data this field can contain.
 java.lang.String getName()
          Returns the name of this field.
 NodeManager getNodeManager()
          Returns the node manager this field belongs to.
 int getState()
          Returns this field's state identifier.
 int getType()
          Returns the identifier for the data type this field contains.
 boolean isRequired()
          Returns whether this field is required (should have content).
 boolean isUnique()
          Returns whether this field is unique (should have content that occurs only once).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getNodeManager

public NodeManager getNodeManager()
Description copied from interface: Field
Returns the node manager this field belongs to.
Specified by:
getNodeManager in interface Field
Following copied from interface: org.mmbase.bridge.Field
Returns:
the node manager this field belongs to

getName

public java.lang.String getName()
Description copied from interface: Field
Returns the name of this field.
Specified by:
getName in interface Field
Following copied from interface: org.mmbase.bridge.Field
Returns:
the name of this field

getGUIType

public java.lang.String getGUIType()
Description copied from interface: Field
Returns the GUI name for the data type this field contains.
Specified by:
getGUIType in interface Field
Following copied from interface: org.mmbase.bridge.Field
Returns:
the GUI name for the data type this field contains

getGUIName

public java.lang.String getGUIName()
Description copied from interface: Field
Returns the GUI name for this field.
Specified by:
getGUIName in interface Field
Following copied from interface: org.mmbase.bridge.Field
Returns:
the GUI name for this field

getDescription

public java.lang.String getDescription()
Description copied from interface: Field
Returns the description for this field.
Specified by:
getDescription in interface Field
Following copied from interface: org.mmbase.bridge.Field
Returns:
the description for this field

getType

public int getType()
Description copied from interface: Field
Returns the identifier for the data type this field contains.
Specified by:
getType in interface Field
Following copied from interface: org.mmbase.bridge.Field
Returns:
an int which identifies the type of data this field contains

getState

public int getState()
Description copied from interface: Field
Returns this field's state identifier.
Specified by:
getState in interface Field
Following copied from interface: org.mmbase.bridge.Field
Returns:
an int which identifies the state of this field

getMaxLength

public int getMaxLength()
Description copied from interface: Field
Returns the maximum length of data this field can contain. For example if a field contains characters the size indicates the maximum number of characters it can contain. If the field is a numeric field (such as an integer), the result is -1.
Specified by:
getMaxLength in interface Field
Following copied from interface: org.mmbase.bridge.Field
Returns:
the maximum length of data this field can contain

isRequired

public boolean isRequired()
Description copied from interface: Field
Returns whether this field is required (should have content). Note that MMBase does not generally enforce required fields to be filled - If not provided, a default value (generally an empty string or the integer value -1) is filled in by the system. As such, isRequired will mostly be used as an indicator for (generic) editors.
Specified by:
isRequired in interface Field
Following copied from interface: org.mmbase.bridge.Field
Returns:
true if the field is required

isUnique

public boolean isUnique()
Description copied from interface: Field
Returns whether this field is unique (should have content that occurs only once). Note that MMBase lets the database layer handle this. If your database or configuration does not support this the uniqueness may not be enforced.
Specified by:
isUnique in interface Field
Following copied from interface: org.mmbase.bridge.Field
Returns:
true if the field is unique

compareTo

public int compareTo(java.lang.Object o)
Compares this field to the passed object. Returns 0 if they are equal, -1 if the object passed is a Field and larger than this field, and +1 if the object passed is a Field and smaller than this field. A field is 'larger' than another field if its preferred GUIName is larger (alphabetically, case sensitive) than that of the other field. If GUINames are the same, the fields are compared on internal field name, and (if needed) on their NodeManagers.
Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - the object to compare it with

equals

public boolean equals(java.lang.Object o)
Compares this field to the passed object, and returns true if they are equal.
Overrides:
equals in class java.lang.Object
Parameters:
o - the object to compare it with


MMBase build 1.6.5.20030923