~ubuntu-branches/ubuntu/trusty/smuxi/trusty-proposed

« back to all changes in this revision

Viewing changes to lib/db4o-net/Db4objects.Db4o.NativeQueries/Db4objects.Db4o.NativeQueries/Expr/Cmp/ComparisonOperator.cs

  • Committer: Package Import Robot
  • Author(s): Mirco Bauer
  • Date: 2013-05-25 22:11:31 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20130525221131-nd2mc0kzubuwyx20
Tags: 0.8.11-1
* [22d13d5] Imported Upstream version 0.8.11
* [6d2b95a] Refreshed patches
* [89eb66e] Added ServiceStack libraries to smuxi-engine package
* [848ab10] Enable Campfire engine
* [c6dbdc7] Always build db4o for predictable build result
* [13ec489] Exclude OS X specific libraries from dh_clideps

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2004 - 2009  Versant Inc.  http://www.db4o.com */
2
 
 
3
 
namespace Db4objects.Db4o.NativeQueries.Expr.Cmp
4
 
{
5
 
        public sealed class ComparisonOperator
6
 
        {
7
 
                public const int EqualsId = 0;
8
 
 
9
 
                public const int SmallerId = 1;
10
 
 
11
 
                public const int GreaterId = 2;
12
 
 
13
 
                public const int ContainsId = 3;
14
 
 
15
 
                public const int StartswithId = 4;
16
 
 
17
 
                public const int EndswithId = 5;
18
 
 
19
 
                public const int IdentityId = 6;
20
 
 
21
 
                public static readonly Db4objects.Db4o.NativeQueries.Expr.Cmp.ComparisonOperator 
22
 
                        ValueEquality = new Db4objects.Db4o.NativeQueries.Expr.Cmp.ComparisonOperator(EqualsId
23
 
                        , "==", true);
24
 
 
25
 
                public static readonly Db4objects.Db4o.NativeQueries.Expr.Cmp.ComparisonOperator 
26
 
                        Smaller = new Db4objects.Db4o.NativeQueries.Expr.Cmp.ComparisonOperator(SmallerId
27
 
                        , "<", false);
28
 
 
29
 
                public static readonly Db4objects.Db4o.NativeQueries.Expr.Cmp.ComparisonOperator 
30
 
                        Greater = new Db4objects.Db4o.NativeQueries.Expr.Cmp.ComparisonOperator(GreaterId
31
 
                        , ">", false);
32
 
 
33
 
                public static readonly Db4objects.Db4o.NativeQueries.Expr.Cmp.ComparisonOperator 
34
 
                        Contains = new Db4objects.Db4o.NativeQueries.Expr.Cmp.ComparisonOperator(ContainsId
35
 
                        , "<CONTAINS>", false);
36
 
 
37
 
                public static readonly Db4objects.Db4o.NativeQueries.Expr.Cmp.ComparisonOperator 
38
 
                        StartsWith = new Db4objects.Db4o.NativeQueries.Expr.Cmp.ComparisonOperator(StartswithId
39
 
                        , "<STARTSWITH>", false);
40
 
 
41
 
                public static readonly Db4objects.Db4o.NativeQueries.Expr.Cmp.ComparisonOperator 
42
 
                        EndsWith = new Db4objects.Db4o.NativeQueries.Expr.Cmp.ComparisonOperator(EndswithId
43
 
                        , "<ENDSWITH>", false);
44
 
 
45
 
                public static readonly Db4objects.Db4o.NativeQueries.Expr.Cmp.ComparisonOperator 
46
 
                        ReferenceEquality = new Db4objects.Db4o.NativeQueries.Expr.Cmp.ComparisonOperator
47
 
                        (IdentityId, "===", true);
48
 
 
49
 
                private int _id;
50
 
 
51
 
                private string _op;
52
 
 
53
 
                private bool _symmetric;
54
 
 
55
 
                private ComparisonOperator(int id, string op, bool symmetric)
56
 
                {
57
 
                        // TODO: switch to individual classes and visitor dispatch?
58
 
                        _id = id;
59
 
                        _op = op;
60
 
                        _symmetric = symmetric;
61
 
                }
62
 
 
63
 
                public int Id()
64
 
                {
65
 
                        return _id;
66
 
                }
67
 
 
68
 
                public override string ToString()
69
 
                {
70
 
                        return _op;
71
 
                }
72
 
 
73
 
                public bool IsSymmetric()
74
 
                {
75
 
                        return _symmetric;
76
 
                }
77
 
        }
78
 
}