|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteasik.sketch.attribute.UniqueKey
public class UniqueKey
Class used to keep track of attributes used in unique key constraints.
| Field Summary | |
|---|---|
private java.util.ArrayList<EntityAttribute> |
_attributes
The attributes contributing to this unique key |
private java.lang.String |
_keyName
The name of this key |
private EntityNode |
_parent
The entity node to which this key applies |
private javax.swing.tree.DefaultMutableTreeNode |
_uniqueKeyNode
The DefaultMutableTreeNode which represents this key graphically on the information tree |
| Constructor Summary | |
|---|---|
UniqueKey(EntityNode inParent,
java.util.ArrayList<EntityAttribute> inAtts,
java.lang.String inName)
Default constructor |
|
| Method Summary | |
|---|---|
java.util.ArrayList |
getAttributes()
Returns an ArrayList of the attributes used in the key |
java.lang.String |
getId()
Gets the id of this unique key. |
java.lang.String |
getKeyName()
Returns the name of the key |
javax.swing.tree.DefaultMutableTreeNode |
getNode()
Returns the node used to display the unique key in the tree |
EntityNode |
getParent()
Returns the parent entity for the key |
static boolean |
isKeyNameUsed(EntityNode inNode,
java.lang.String keyName)
Returns if the name of a key is already used |
static boolean |
isKeyUnique(EntityNode inNode,
java.lang.String keyID)
Returns if the key is unique or if another key exists with the exact same attributes |
void |
setAttributes(java.util.ArrayList<EntityAttribute> inAtts)
Sets the attributes involved in this unique key to the attributes present in |
void |
setKeyName(java.lang.String inName)
Sets the key name to the name described in |
void |
setNode(javax.swing.tree.DefaultMutableTreeNode inNode)
Sets the node used to display the unique key in the tree |
static void |
testUnique(EntityNode inNode)
Tests to see if there is any duplicate unique keys |
java.lang.String |
toString()
Overwriten method returns attribute list separated by semicolons |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.util.ArrayList<EntityAttribute> _attributes
private java.lang.String _keyName
private EntityNode _parent
private javax.swing.tree.DefaultMutableTreeNode _uniqueKeyNode
| Constructor Detail |
|---|
public UniqueKey(EntityNode inParent,
java.util.ArrayList<EntityAttribute> inAtts,
java.lang.String inName)
inParent - The EntityNode to which this unique key appliesinAtts - An ArrayList of the attributes used in the keyinName - The name of the key| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getId()
public java.util.ArrayList getAttributes()
public void setAttributes(java.util.ArrayList<EntityAttribute> inAtts)
inAtts - Arraylist of EntityAttributepublic java.lang.String getKeyName()
public void setKeyName(java.lang.String inName)
inName - The name of this attributepublic EntityNode getParent()
public void setNode(javax.swing.tree.DefaultMutableTreeNode inNode)
inNode - The node used to display the unique key in the treepublic javax.swing.tree.DefaultMutableTreeNode getNode()
public static boolean isKeyNameUsed(EntityNode inNode,
java.lang.String keyName)
inNode - The entity being checked againstkeyName - The name of the key
public static boolean isKeyUnique(EntityNode inNode,
java.lang.String keyID)
inNode - The entity being checked againstkeyID - The list of attributes in the key
public static void testUnique(EntityNode inNode)
inNode - The node being tested
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||