SearchCondition.java :  » Content-Management-System » harmonise » com » ibm » webdav » Java Open Source

Java Open Source » Content Management System » harmonise 
harmonise » com » ibm » webdav » SearchCondition.java
/*
 * (C) Copyright Simulacra Media Ltd, 2004.  All rights reserved.
 *
 * The program is provided "AS IS" without any warranty express or
 * implied, including the warranty of non-infringement and the implied
 * warranties of merchantibility and fitness for a particular purpose.
 * Simulacra Media Ltd will not be liable for any damages suffered by you as a result
 * of using the Program. In no event will Simulacra Media Ltd be liable for any
 * special, indirect or consequential damages or lost profits even if
 * Simulacra Media Ltd has been advised of the possibility of their occurrence. 
 * Simulacra Media Ltd will not be liable for any third party claims against you.
 */

package com.ibm.webdav;

import java.util.*;

/**
 * @author Michael Bell
 * @version $Revision: 1.1 $
 */

public class SearchCondition {

  protected Vector m_conditions = new Vector();
  protected String m_sOperator = "and";

  public SearchCondition() {
  }

  public void addCondition(SearchConditionTerm term) {
    m_conditions.add(term);
  }

  public void addCondition(SearchCondition cond) {
    m_conditions.add(cond);
  }

  public void setOperator(String sOp) {
    m_sOperator = sOp;
  }

  public String getOperator() {
    return m_sOperator;
  }

  public int size() {
    return this.m_conditions.size();
  }

  public Object getCondition(int index) {
    return m_conditions.elementAt(index);
  }

  public boolean isConditionLeaf(Object obj) {
    return (obj instanceof SearchConditionTerm);
  }

  public boolean isConditionLeaf(int index) {
    return isConditionLeaf(this.m_conditions.elementAt(index));
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.