2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.persistence
.dao
.taxon
.tmp
;
12 import java
.util
.UUID
;
14 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
15 import eu
.etaxonomy
.cdm
.model
.common
.ITreeNode
;
18 * Preliminary class which represents a filter for an export on a CdmBase object, combined
19 * with a logical operation.
20 * Added to an existing filter it may e.g. allow operations like "filter1 or filter(TaxonNode:123)"
21 * It includes the logical operators as enums.
26 public class LogicFilter
<T
extends CdmBase
> {
30 // OR(" OR "), AND(" AND "), NOT(" NOT ");
33 // private Op(String opStr){
38 private static final Op defaultOperator
= Op
.OR
;
40 private Op operator
= defaultOperator
;
43 private String treeIndex
;
47 public LogicFilter(T cdmBase
){
48 this(cdmBase
, defaultOperator
);
51 public LogicFilter(T cdmBase
, Op operator
){
53 throw new IllegalArgumentException("Null object not allowed as filter criteria");
55 if (operator
== null){
56 operator
= defaultOperator
;
59 this.uuid
= cdmBase
.getUuid();
60 this.operator
= operator
;
61 CdmBase cdmBase2
= CdmBase
.deproxy(cdmBase
, CdmBase
.class);
62 if (cdmBase2
instanceof ITreeNode
){
63 this.treeIndex
= ((ITreeNode
<?
>)cdmBase2
).treeIndex();
67 public Op
getOperator() {
71 public UUID
getUuid() {
75 public String
getTreeIndex() {