01: /*
02: * IsNotNullComparator.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.storage.filter;
13:
14: /**
15: * @author support@sql-workbench.net
16: */
17: public class IsNotNullComparator implements ColumnComparator {
18: public IsNotNullComparator() {
19: }
20:
21: public String getValueExpression(Object value) {
22: return (value == null ? "" : value.toString());
23: }
24:
25: public String getOperator() {
26: return "not null";
27: }
28:
29: public boolean needsValue() {
30: return false;
31: }
32:
33: public boolean validateInput(Object value) {
34: return true;
35: }
36:
37: public boolean comparesEquality() {
38: return false;
39: }
40:
41: public boolean evaluate(Object reference, Object value,
42: boolean ignoreCase) {
43: return (value != null);
44: }
45:
46: public boolean supportsType(Class valueClass) {
47: return true;
48: }
49:
50: public boolean supportsIgnoreCase() {
51: return false;
52: }
53:
54: public boolean equals(Object other) {
55: return (other instanceof IsNotNullComparator);
56: }
57: }
|