1 43 44 package org.exolab.jms.selector; 45 46 47 63 abstract class SObject { 64 65 70 public abstract Object getObject(); 71 72 80 public SBool equal(final SObject obj) { 81 SBool result = SBool.FALSE; 82 if (getObject().equals(obj.getObject())) { 83 result = SBool.TRUE; 84 } 85 return result; 86 } 87 88 96 public SBool notEqual(final SObject obj) { 97 SBool result = equal(obj); 98 if (result != null) { 99 result = result.not(); 100 } 101 return result; 102 } 103 104 112 public SBool less(final SObject obj) { 113 return null; 114 } 115 116 124 public SBool greater(final SObject obj) { 125 return null; 126 } 127 128 136 public SBool lessEqual(final SObject obj) { 137 SBool result = less(obj); 138 if (result != null && !result.value()) { 139 result = equal(obj); 140 } 141 return result; 142 } 143 144 152 public SBool greaterEqual(final SObject obj) { 153 SBool result = greater(obj); 154 if (result != null && !result.value()) { 155 result = equal(obj); 156 } 157 return result; 158 } 159 160 165 public String toString() { 166 return getObject().toString(); 167 } 168 169 174 public abstract Type type(); 175 176 } | Popular Tags |