--- jlscp/trunk/src/org/linuxsampler/lscp/SamplerEngine.java 2005/10/02 14:40:52 783
+++ jlscp/trunk/src/org/linuxsampler/lscp/SamplerEngine.java 2005/10/10 14:55:44 784
@@ -93,9 +93,33 @@
}
/**
- * Returns the name of this sampler engine.
- * @return The name of this sampler engine.
+ * Compares this SamplerEngine
instance to the specified object.
+ * The result is true
if obj
is reference to
+ * this
, or if obj
is a SamplerEngine
instance
+ * and has non-null
name equal to the name of this engine.
+ *
+ * @return true
if obj
is reference to
+ * this
, or if obj
is a SamplerEngine
instance
+ * and has non-null
name equal to the name of this engine;
+ * false
otherwise.
+ * @see #getName
+ */
+ public boolean
+ equals(Object obj) {
+ if(this == obj) return true;
+
+ if(getName() == null || obj == null) return false;
+
+ if(obj instanceof SamplerEngine)
+ return getName().equals(((SamplerEngine)obj).getName());
+
+ return false;
+ }
+
+ /**
+ * Returns the description of this sampler engine.
+ * @return The description of this sampler engine.
*/
public String
- toString() { return getName(); }
+ toString() { return getDescription(); }
}