From 0a3bcdbfcca1e8d3ff4898b1b126516f62c8c813 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 19 Jan 2007 00:01:16 +0000 Subject: [PATCH] Two operators from Zell. --- .../jdbc/depot/operator/Arithmetic.java | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/java/com/samskivert/jdbc/depot/operator/Arithmetic.java b/src/java/com/samskivert/jdbc/depot/operator/Arithmetic.java index 41308ca..f89cf16 100644 --- a/src/java/com/samskivert/jdbc/depot/operator/Arithmetic.java +++ b/src/java/com/samskivert/jdbc/depot/operator/Arithmetic.java @@ -130,4 +130,54 @@ public abstract class Arithmetic return "/"; } } + + /** The SQL '&' operator. */ + public static class BitAnd extends BinaryOperator + { + public BitAnd (String pColumn, Comparable value) + { + super(new ColumnExp(pColumn), value); + } + + public BitAnd (SQLExpression column, Comparable value) + { + super(column, value); + } + + public BitAnd (SQLExpression column, SQLExpression value) + { + super(column, value); + } + + @Override + protected String operator() + { + return "&"; + } + } + + /** The SQL '|' operator. */ + public static class BitOr extends BinaryOperator + { + public BitOr (String pColumn, Comparable value) + { + super(new ColumnExp(pColumn), value); + } + + public BitOr (SQLExpression column, Comparable value) + { + super(column, value); + } + + public BitOr (SQLExpression column, SQLExpression value) + { + super(column, value); + } + + @Override + protected String operator() + { + return "|"; + } + } }