com.bonevich.erj.model
Class Attribute
java.lang.Object
|
+--com.bonevich.erj.model.ModelElement
|
+--com.bonevich.erj.model.Attribute
- All Implemented Interfaces:
- ErjConstants
- public final class Attribute
- extends ModelElement
A class that represents an attribute of a relation
(i.e. a column in a table). Attributes must have a type
(which may be a predefined DataType or
a user-defined Domain, both of which
implement the AttributeType
typing interface) and a constraint (NULL or NOTNULL as
defined by AttributeConstraint).
Attributes also may optionally have a default value and
a set of associated keys.
- Author:
- Jeffrey D. Bonevich
- See Also:
Relation,
AttributeType,
AttributeConstraint,
KeyConstraint
| Fields inherited from interface com.bonevich.erj.ErjConstants |
EDITOR_COLOR, EDITOR_FONT, EMPTY_STR, ICON_AK, ICON_DOMAIN, ICON_FK, ICON_FOREIGNKEY, ICON_NOTNULL, ICON_NULL, ICON_PK, ICON_RELATION, ICON_SCHEMA, ICON_SPLASH, INITIAL_FRAME_SIZE, LABEL_COLOR, LABEL_FILL, LABEL_FONT, LABEL_FONT_ITALIC, LABEL_FONT_SIZE, LABEL_FONTMETRICS, STATUSBAR_COLOR, STATUSBAR_FONT, STATUSBAR_FONT_ITALIC, STATUSBAR_MOD_FILL, SUBLABEL_FILL |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NEW_ATTRIBUTE_STR
public static final java.lang.String NEW_ATTRIBUTE_STR
- See Also:
- Constant Field Values
Attribute
public Attribute(Relation relation)
- Create a new attribute for a given
Relation.
You should use Relation.createAttribute()
Attribute
protected Attribute(Relation relation,
Attribute that)
Attribute
public Attribute()
- Default constructor needed for diagram loading.
getType
public AttributeType getType()
setType
public void setType(AttributeType type)
getDefaultValue
public DefaultValue getDefaultValue()
setDefaultValue
public void setDefaultValue(DefaultValue value)
setConstraint
public void setConstraint(AttributeConstraint constraint)
getConstraint
public AttributeConstraint getConstraint()
getRelation
public Relation getRelation()
addKey
public void addKey(KeyConstraint key)
removeKey
public void removeKey(KeyConstraint key)
getKeyIterator
public java.util.Iterator getKeyIterator()
isPrimaryKey
public boolean isPrimaryKey()
isUniqueKey
public boolean isUniqueKey()
isForeignKey
public boolean isForeignKey()
dispose
public void dispose()
- Delete all keys of which this attribute is a member.
- Specified by:
dispose in class ModelElement
equals
public boolean equals(java.lang.Object rhs)
- Overrides:
equals in class ModelElement
accept
public void accept(ModelElementVisitor visitor)
- Specified by:
accept in class ModelElement
Copyright © 2001-2003 bonevich.com. All Rights Reserved.