Author: doogie
Date: Wed Oct 17 20:31:46 2007
New Revision: 585823
URL:
http://svn.apache.org/viewvc?rev=585823&view=revLog:
Implement Comparable on a few classes.
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityOperator.java
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java?rev=585823&r1=585822&r2=585823&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java Wed Oct 17 20:31:46 2007
@@ -1379,11 +1379,15 @@
}
}
- public static class NullField implements NULL {
+ public static class NullField implements NULL, Comparable {
protected NullField() { }
public String toString() {
return "[null-field]";
+ }
+
+ public int compareTo(Object other) {
+ return this != other ? -1 : 0;
}
}
}
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityOperator.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityOperator.java?rev=585823&r1=585822&r2=585823&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityOperator.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityOperator.java Wed Oct 17 20:31:46 2007
@@ -225,7 +225,12 @@
public abstract EntityCondition freeze(Object lhs, Object rhs);
public abstract void visit(EntityConditionVisitor visitor, Object lhs, Object rhs);
- public static final Object WILDCARD = new Object() {
+ public static final Comparable WILDCARD = new Comparable() {
+ public int compareTo(Object obj) {
+ if (obj != WILDCARD) throw new ClassCastException();
+ return 0;
+ }
+
public String toString() {
return "(WILDCARD)";
}