/**
 * ORType.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter.
 */

package org.ecoinformatics.ecogrid.queryservice.query;


/**
 * A type of logical operator that evaluates to true 
 *             if any one or more of its child conditions evaluate to
 * true.
 */
public class ORType  implements java.io.Serializable {
    private org.ecoinformatics.ecogrid.queryservice.query.ANDType[] AND;

    private org.ecoinformatics.ecogrid.queryservice.query.ORType[] OR;

    private org.ecoinformatics.ecogrid.queryservice.query.ConditionType[] condition;

    public ORType() {
    }

    public ORType(
           org.ecoinformatics.ecogrid.queryservice.query.ANDType[] AND,
           org.ecoinformatics.ecogrid.queryservice.query.ORType[] OR,
           org.ecoinformatics.ecogrid.queryservice.query.ConditionType[] condition) {
           this.AND = AND;
           this.OR = OR;
           this.condition = condition;
    }


    /**
     * Gets the AND value for this ORType.
     * 
     * @return AND
     */
    public org.ecoinformatics.ecogrid.queryservice.query.ANDType[] getAND() {
        return AND;
    }


    /**
     * Sets the AND value for this ORType.
     * 
     * @param AND
     */
    public void setAND(org.ecoinformatics.ecogrid.queryservice.query.ANDType[] AND) {
        this.AND = AND;
    }

    public org.ecoinformatics.ecogrid.queryservice.query.ANDType getAND(int i) {
        return this.AND[i];
    }

    public void setAND(int i, org.ecoinformatics.ecogrid.queryservice.query.ANDType _value) {
        this.AND[i] = _value;
    }


    /**
     * Gets the OR value for this ORType.
     * 
     * @return OR
     */
    public org.ecoinformatics.ecogrid.queryservice.query.ORType[] getOR() {
        return OR;
    }


    /**
     * Sets the OR value for this ORType.
     * 
     * @param OR
     */
    public void setOR(org.ecoinformatics.ecogrid.queryservice.query.ORType[] OR) {
        this.OR = OR;
    }

    public org.ecoinformatics.ecogrid.queryservice.query.ORType getOR(int i) {
        return this.OR[i];
    }

    public void setOR(int i, org.ecoinformatics.ecogrid.queryservice.query.ORType _value) {
        this.OR[i] = _value;
    }


    /**
     * Gets the condition value for this ORType.
     * 
     * @return condition
     */
    public org.ecoinformatics.ecogrid.queryservice.query.ConditionType[] getCondition() {
        return condition;
    }


    /**
     * Sets the condition value for this ORType.
     * 
     * @param condition
     */
    public void setCondition(org.ecoinformatics.ecogrid.queryservice.query.ConditionType[] condition) {
        this.condition = condition;
    }

    public org.ecoinformatics.ecogrid.queryservice.query.ConditionType getCondition(int i) {
        return this.condition[i];
    }

    public void setCondition(int i, org.ecoinformatics.ecogrid.queryservice.query.ConditionType _value) {
        this.condition[i] = _value;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof ORType)) return false;
        ORType other = (ORType) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true && 
            ((this.AND==null && other.getAND()==null) || 
             (this.AND!=null &&
              java.util.Arrays.equals(this.AND, other.getAND()))) &&
            ((this.OR==null && other.getOR()==null) || 
             (this.OR!=null &&
              java.util.Arrays.equals(this.OR, other.getOR()))) &&
            ((this.condition==null && other.getCondition()==null) || 
             (this.condition!=null &&
              java.util.Arrays.equals(this.condition, other.getCondition())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getAND() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getAND());
                 i++) {
                java.lang.Object obj = java.lang.reflect.Array.get(getAND(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        if (getOR() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getOR());
                 i++) {
                java.lang.Object obj = java.lang.reflect.Array.get(getOR(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        if (getCondition() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getCondition());
                 i++) {
                java.lang.Object obj = java.lang.reflect.Array.get(getCondition(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(ORType.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://ecoinformatics.org/query-1.0.1", "ORType"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("AND");
        elemField.setXmlName(new javax.xml.namespace.QName("", "AND"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://ecoinformatics.org/query-1.0.1", "ANDType"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        elemField.setMaxOccursUnbounded(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("OR");
        elemField.setXmlName(new javax.xml.namespace.QName("", "OR"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://ecoinformatics.org/query-1.0.1", "ORType"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        elemField.setMaxOccursUnbounded(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("condition");
        elemField.setXmlName(new javax.xml.namespace.QName("", "condition"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://ecoinformatics.org/query-1.0.1", "ConditionType"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        elemField.setMaxOccursUnbounded(true);
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType, 
           java.lang.Class _javaType,  
           javax.xml.namespace.QName _xmlType) {
        return 
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType, 
           java.lang.Class _javaType,  
           javax.xml.namespace.QName _xmlType) {
        return 
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}
