r9996 - helma/helma/trunk/src/helma/objectmodel/db
[email protected] Wed, 25 Nov 2009 14:22:07 +0100 (CET)
| Newsgroups | gmane.comp.java.helma.cvs |
|---|---|
| Message-ID | <20091125132207.D09DC3D0E2@mia> |
Author: hannes
Date: 2009-11-25 14:22:07 +0100 (Wed, 25 Nov 2009)
New Revision: 9996
Modified:
helma/helma/trunk/src/helma/objectmodel/db/SyntheticKey.java
Log:
Code cleanup
Details at http://dev.helma.org/trac/helma/changeset/9996
Modified: helma/helma/trunk/src/helma/objectmodel/db/SyntheticKey.java
===================================================================
--- helma/helma/trunk/src/helma/objectmodel/db/SyntheticKey.java 2009-11-25 10:55:51 UTC (rev 9995)
+++ helma/helma/trunk/src/helma/objectmodel/db/SyntheticKey.java 2009-11-25 13:22:07 UTC (rev 9996)
@@ -38,7 +38,9 @@
static final long serialVersionUID = -693454133259421857L;
/**
- * make a key for a persistent Object, describing its datasource and id.
+ * Make a symbolic key for an object using its parent key and its property name/id.
+ * @param key the parent key
+ * @param name the property or collection name
*/
public SyntheticKey(Key key, String name) {
this.parentKey = key;
@@ -46,35 +48,32 @@
}
/**
- *
- *
- * @param what ...
- *
- * @return ...
+ * Returns true if this key equals obj
+ * @param obj another object
+ * @return true if obj represents the same key as this
*/
- public boolean equals(Object what) {
- if (what == this) {
+ public boolean equals(Object obj) {
+ if (obj == this) {
return true;
}
- if (!(what instanceof SyntheticKey)) {
+ if (!(obj instanceof SyntheticKey)) {
return false;
}
- SyntheticKey k = (SyntheticKey) what;
+ SyntheticKey k = (SyntheticKey) obj;
return parentKey.equals(k.parentKey) &&
((name == k.name) || name.equalsIgnoreCase(k.name));
}
/**
- *
- *
- * @return ...
+ * Get the hash-code for this key
+ * @return the hash-code
*/
public int hashCode() {
if (hashcode == 0) {
- hashcode = 17 + (37 * name.toLowerCase().hashCode()) +
+ hashcode = 17 + (37 * name.toLowerCase().hashCode()) +
(37 * parentKey.hashCode());
}
@@ -82,36 +81,32 @@
}
/**
- *
- *
- * @return ...
+ * Get the parent key part of this key
+ * @return the parent key
*/
public Key getParentKey() {
return parentKey;
}
/**
- *
- *
- * @return ...
+ * Get the ID part of this key
+ * @return the id part
*/
public String getID() {
return name;
}
/**
- *
- *
- * @return ...
+ * Get the storage name for this key. This alwys returns null for symbolic keys.
+ * @return null
*/
public String getStorageName() {
return null;
}
/**
- *
- *
- * @return ...
+ * Return a string representation for this key
+ * @return a string representation for this key
*/
public String toString() {
return parentKey + "/" + name;