/**
 * ResultsetType.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.resultset;


/**
 * A type used to represent the results of a query
 *             in XML format, including both the metadata about the set
 * of result
 *             records, the identifiers for each record, and optionally
 * an extract
 *             of the record itself in XML format.
 */
public class ResultsetType  implements java.io.Serializable {
    /* Documentation about the entire set of
     *                     results. */
    private org.ecoinformatics.ecogrid.queryservice.resultset.ResultsetTypeResultsetMetadata resultsetMetadata;

    /* An individual record from the query
     *                     providing a relative index into the resultset
     * for this
     *                     record, the identifier which can be used to retrieve
     * the
     *                     whole record, and optionally some element content
     * from the
     *                     record. */
    private org.ecoinformatics.ecogrid.queryservice.resultset.ResultsetTypeRecord[] record;

    private org.apache.axis.types.URI system;  // attribute

    private java.lang.String resultsetId;  // attribute

    private java.lang.String attrs;  // attribute

    public ResultsetType() {
    }

    public ResultsetType(
           org.ecoinformatics.ecogrid.queryservice.resultset.ResultsetTypeResultsetMetadata resultsetMetadata,
           org.ecoinformatics.ecogrid.queryservice.resultset.ResultsetTypeRecord[] record,
           org.apache.axis.types.URI system,
           java.lang.String resultsetId,
           java.lang.String attrs) {
           this.resultsetMetadata = resultsetMetadata;
           this.record = record;
           this.system = system;
           this.resultsetId = resultsetId;
           this.attrs = attrs;
    }


    /**
     * Gets the resultsetMetadata value for this ResultsetType.
     * 
     * @return resultsetMetadata   * Documentation about the entire set of
     *                     results.
     */
    public org.ecoinformatics.ecogrid.queryservice.resultset.ResultsetTypeResultsetMetadata getResultsetMetadata() {
        return resultsetMetadata;
    }


    /**
     * Sets the resultsetMetadata value for this ResultsetType.
     * 
     * @param resultsetMetadata   * Documentation about the entire set of
     *                     results.
     */
    public void setResultsetMetadata(org.ecoinformatics.ecogrid.queryservice.resultset.ResultsetTypeResultsetMetadata resultsetMetadata) {
        this.resultsetMetadata = resultsetMetadata;
    }


    /**
     * Gets the record value for this ResultsetType.
     * 
     * @return record   * An individual record from the query
     *                     providing a relative index into the resultset
     * for this
     *                     record, the identifier which can be used to retrieve
     * the
     *                     whole record, and optionally some element content
     * from the
     *                     record.
     */
    public org.ecoinformatics.ecogrid.queryservice.resultset.ResultsetTypeRecord[] getRecord() {
        return record;
    }


    /**
     * Sets the record value for this ResultsetType.
     * 
     * @param record   * An individual record from the query
     *                     providing a relative index into the resultset
     * for this
     *                     record, the identifier which can be used to retrieve
     * the
     *                     whole record, and optionally some element content
     * from the
     *                     record.
     */
    public void setRecord(org.ecoinformatics.ecogrid.queryservice.resultset.ResultsetTypeRecord[] record) {
        this.record = record;
    }

    public org.ecoinformatics.ecogrid.queryservice.resultset.ResultsetTypeRecord getRecord(int i) {
        return this.record[i];
    }

    public void setRecord(int i, org.ecoinformatics.ecogrid.queryservice.resultset.ResultsetTypeRecord _value) {
        this.record[i] = _value;
    }


    /**
     * Gets the system value for this ResultsetType.
     * 
     * @return system
     */
    public org.apache.axis.types.URI getSystem() {
        return system;
    }


    /**
     * Sets the system value for this ResultsetType.
     * 
     * @param system
     */
    public void setSystem(org.apache.axis.types.URI system) {
        this.system = system;
    }


    /**
     * Gets the resultsetId value for this ResultsetType.
     * 
     * @return resultsetId
     */
    public java.lang.String getResultsetId() {
        return resultsetId;
    }


    /**
     * Sets the resultsetId value for this ResultsetType.
     * 
     * @param resultsetId
     */
    public void setResultsetId(java.lang.String resultsetId) {
        this.resultsetId = resultsetId;
    }


    /**
     * Gets the attrs value for this ResultsetType.
     * 
     * @return attrs
     */
    public java.lang.String getAttrs() {
        return attrs;
    }


    /**
     * Sets the attrs value for this ResultsetType.
     * 
     * @param attrs
     */
    public void setAttrs(java.lang.String attrs) {
        this.attrs = attrs;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof ResultsetType)) return false;
        ResultsetType other = (ResultsetType) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true && 
            ((this.resultsetMetadata==null && other.getResultsetMetadata()==null) || 
             (this.resultsetMetadata!=null &&
              this.resultsetMetadata.equals(other.getResultsetMetadata()))) &&
            ((this.record==null && other.getRecord()==null) || 
             (this.record!=null &&
              java.util.Arrays.equals(this.record, other.getRecord()))) &&
            ((this.system==null && other.getSystem()==null) || 
             (this.system!=null &&
              this.system.equals(other.getSystem()))) &&
            ((this.resultsetId==null && other.getResultsetId()==null) || 
             (this.resultsetId!=null &&
              this.resultsetId.equals(other.getResultsetId()))) &&
            ((this.attrs==null && other.getAttrs()==null) || 
             (this.attrs!=null &&
              this.attrs.equals(other.getAttrs())));
        __equalsCalc = null;
        return _equals;
    }

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

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

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://ecoinformatics.org/resultset-1.0.1", "ResultsetType"));
        org.apache.axis.description.AttributeDesc attrField = new org.apache.axis.description.AttributeDesc();
        attrField.setFieldName("system");
        attrField.setXmlName(new javax.xml.namespace.QName("", "system"));
        attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "anyURI"));
        typeDesc.addFieldDesc(attrField);
        attrField = new org.apache.axis.description.AttributeDesc();
        attrField.setFieldName("resultsetId");
        attrField.setXmlName(new javax.xml.namespace.QName("", "resultsetId"));
        attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        typeDesc.addFieldDesc(attrField);
        attrField = new org.apache.axis.description.AttributeDesc();
        attrField.setFieldName("attrs");
        attrField.setXmlName(new javax.xml.namespace.QName("", "attrs"));
        attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        typeDesc.addFieldDesc(attrField);
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("resultsetMetadata");
        elemField.setXmlName(new javax.xml.namespace.QName("http://ecoinformatics.org/resultset-1.0.1", "resultsetMetadata"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://ecoinformatics.org/resultset-1.0.1", ">ResultsetType>resultsetMetadata"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("record");
        elemField.setXmlName(new javax.xml.namespace.QName("http://ecoinformatics.org/resultset-1.0.1", "record"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://ecoinformatics.org/resultset-1.0.1", ">ResultsetType>record"));
        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);
    }

}
