Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * This class was automatically generated with 
   * <a href="http://www.castor.org">Castor 1.3.1</a>, using an XML
   * Schema.
   * $Id$
   */
  
  package org.twinkql.model;

Class Conditional.

Version:
$Revision$ $Date$
 
 @SuppressWarnings("serial")
 public abstract class Conditional implements java.io.Serializable {
 
 
       //--------------------------/
      //- Class/Member Variables -/
     //--------------------------/
 
    
Field _function.
 
     private java.lang.String _function;

    
Field _param.
 
     private java.lang.String _param;

    
Field _items.
 
 
 
       //----------------/
      //- Constructors -/
     //----------------/
 
     public Conditional() {
         super();
         this. = new java.util.ArrayList<org.twinkql.model.ConditionalItem>();
     }
 
 
       //-----------/
      //- Methods -/
     //-----------/
 
    

Parameters:
vConditionalItem
Throws:
java.lang.IndexOutOfBoundsException if the index given is outside the bounds of the collection
 
     public void addConditionalItem(
             final org.twinkql.model.ConditionalItem vConditionalItem)
         this..add(vConditionalItem);
     }

    

Parameters:
index
vConditionalItem
Throws:
java.lang.IndexOutOfBoundsException if the index given is outside the bounds of the collection
 
     public void addConditionalItem(
             final int index,
             final org.twinkql.model.ConditionalItem vConditionalItem)
         this..add(indexvConditionalItem);
     }

    
Method enumerateConditionalItem.

Returns:
an Enumeration over all possible elements of this collection
 
     ) {
         return java.util.Collections.enumeration(this.);
     }

    
Overrides the java.lang.Object.equals method.

Parameters:
obj
Returns:
true if the objects are equal.
 
     @Override()
     public boolean equals(
            final java.lang.Object obj) {
        if ( this == obj )
            return true;
        if (obj instanceof Conditional) {
            Conditional temp = (Conditional)obj;
            boolean thcycle;
            boolean tmcycle;
            if (this. != null) {
                if (temp._function == nullreturn false;
                if (this. != temp._function) {
                    thcycle=org.castor.core.util.CycleBreaker.startingToCycle(this.);
                    tmcycle=org.castor.core.util.CycleBreaker.startingToCycle(temp._function);
                    if (thcycle!=tmcycle) {
                        if (!thcycle) { org.castor.core.util.CycleBreaker.releaseCycleHandle(this.); };
                        if (!tmcycle) { org.castor.core.util.CycleBreaker.releaseCycleHandle(temp._function); };
                        return false;
                    }
                    if (!thcycle) {
                        if (!this..equals(temp._function)) {
                            org.castor.core.util.CycleBreaker.releaseCycleHandle(this.);
                            org.castor.core.util.CycleBreaker.releaseCycleHandle(temp._function);
                            return false;
                        }
                        org.castor.core.util.CycleBreaker.releaseCycleHandle(this.);
                        org.castor.core.util.CycleBreaker.releaseCycleHandle(temp._function);
                    }
                }
            } else if (temp._function != null)
                return false;
            if (this. != null) {
                if (temp._param == nullreturn false;
                if (this. != temp._param) {
                    thcycle=org.castor.core.util.CycleBreaker.startingToCycle(this.);
                    tmcycle=org.castor.core.util.CycleBreaker.startingToCycle(temp._param);
                    if (thcycle!=tmcycle) {
                        if (!thcycle) { org.castor.core.util.CycleBreaker.releaseCycleHandle(this.); };
                        if (!tmcycle) { org.castor.core.util.CycleBreaker.releaseCycleHandle(temp._param); };
                        return false;
                    }
                    if (!thcycle) {
                        if (!this..equals(temp._param)) {
                            org.castor.core.util.CycleBreaker.releaseCycleHandle(this.);
                            org.castor.core.util.CycleBreaker.releaseCycleHandle(temp._param);
                            return false;
                        }
                        org.castor.core.util.CycleBreaker.releaseCycleHandle(this.);
                        org.castor.core.util.CycleBreaker.releaseCycleHandle(temp._param);
                    }
                }
            } else if (temp._param != null)
                return false;
            if (this. != null) {
                if (temp._items == nullreturn false;
                if (this. != temp._items) {
                    thcycle=org.castor.core.util.CycleBreaker.startingToCycle(this.);
                    tmcycle=org.castor.core.util.CycleBreaker.startingToCycle(temp._items);
                    if (thcycle!=tmcycle) {
                        if (!thcycle) { org.castor.core.util.CycleBreaker.releaseCycleHandle(this.); };
                        if (!tmcycle) { org.castor.core.util.CycleBreaker.releaseCycleHandle(temp._items); };
                        return false;
                    }
                    if (!thcycle) {
                        if (!this..equals(temp._items)) {
                            org.castor.core.util.CycleBreaker.releaseCycleHandle(this.);
                            org.castor.core.util.CycleBreaker.releaseCycleHandle(temp._items);
                            return false;
                        }
                        org.castor.core.util.CycleBreaker.releaseCycleHandle(this.);
                        org.castor.core.util.CycleBreaker.releaseCycleHandle(temp._items);
                    }
                }
            } else if (temp._items != null)
                return false;
            return true;
        }
        return false;
    }

    
Method getConditionalItem.

Parameters:
index
Returns:
the value of the org.twinkql.model.ConditionalItem at the given index
Throws:
java.lang.IndexOutOfBoundsException if the index given is outside the bounds of the collection
            final int index)
        // check bounds for index
        if (index < 0 || index >= this..size()) {
            throw new IndexOutOfBoundsException("getConditionalItem: Index value '" + index + "' not in range [0.." + (this..size() - 1) + "]");
        }
        return (org.twinkql.model.ConditionalItem.get(index);
    }

    
Method getConditionalItem.Returns the contents of the collection in an Array.

Note: Just in case the collection contents are changing in another thread, we pass a 0-length Array of the correct type into the API call. This way we know that the Array returned is of exactly the correct length.

Returns:
this collection as an Array
    ) {
        org.twinkql.model.ConditionalItem[] array = new org.twinkql.model.ConditionalItem[0];
        return (org.twinkql.model.ConditionalItem[]) this..toArray(array);
    }

    
Method getConditionalItemCount.

Returns:
the size of this collection
    public int getConditionalItemCount(
    ) {
        return this..size();
    }

    
Returns the value of field 'function'.

Returns:
the value of field 'Function'.
    public java.lang.String getFunction(
    ) {
        return this.;
    }

    
Returns the value of field 'param'.

Returns:
the value of field 'Param'.
    public java.lang.String getParam(
    ) {
        return this.;
    }

    
Overrides the java.lang.Object.hashCode method.

The following steps came from Effective Java Programming Language Guide by Joshua Bloch, Chapter 3

Returns:
a hash code value for the object.
    public int hashCode(
    ) {
        int result = 17;
        long tmp;
        if ( != null
               && !org.castor.core.util.CycleBreaker.startingToCycle()) {
           result = 37 * result + .hashCode();
           org.castor.core.util.CycleBreaker.releaseCycleHandle();
        }
        if ( != null
               && !org.castor.core.util.CycleBreaker.startingToCycle()) {
           result = 37 * result + .hashCode();
           org.castor.core.util.CycleBreaker.releaseCycleHandle();
        }
        if ( != null
               && !org.castor.core.util.CycleBreaker.startingToCycle()) {
           result = 37 * result + .hashCode();
           org.castor.core.util.CycleBreaker.releaseCycleHandle();
        }
        return result;
    }

    
Method isValid.

Returns:
true if this object is valid according to the schema
    public boolean isValid(
    ) {
        try {
            validate();
        } catch (org.exolab.castor.xml.ValidationException vex) {
            return false;
        }
        return true;
    }

    
Method iterateConditionalItem.

Returns:
an Iterator over all possible elements in this collection
    ) {
        return this..iterator();
    }

    
    public void removeAllConditionalItem(
    ) {
        this..clear();
    }

    
Method removeConditionalItem.

Parameters:
vConditionalItem
Returns:
true if the object was removed from the collection.
    public boolean removeConditionalItem(
            final org.twinkql.model.ConditionalItem vConditionalItem) {
        boolean removed = .remove(vConditionalItem);
        return removed;
    }

    
Method removeConditionalItemAt.

Parameters:
index
Returns:
the element removed from the collection
            final int index) {
        java.lang.Object obj = this..remove(index);
        return (org.twinkql.model.ConditionalItemobj;
    }

    

Parameters:
index
vConditionalItem
Throws:
java.lang.IndexOutOfBoundsException if the index given is outside the bounds of the collection
    public void setConditionalItem(
            final int index,
            final org.twinkql.model.ConditionalItem vConditionalItem)
        // check bounds for index
        if (index < 0 || index >= this..size()) {
            throw new IndexOutOfBoundsException("setConditionalItem: Index value '" + index + "' not in range [0.." + (this..size() - 1) + "]");
        }
        this..set(indexvConditionalItem);
    }

    

Parameters:
vConditionalItemArray
    public void setConditionalItem(
            final org.twinkql.model.ConditionalItem[] vConditionalItemArray) {
        //-- copy array
        .clear();
        for (int i = 0; i < vConditionalItemArray.lengthi++) {
                this..add(vConditionalItemArray[i]);
        }
    }

    
Sets the value of field 'function'.

Parameters:
function the value of field 'function'.
    public void setFunction(
            final java.lang.String function) {
        this. = function;
    }

    
Sets the value of field 'param'.

Parameters:
param the value of field 'param'.
    public void setParam(
            final java.lang.String param) {
        this. = param;
    }

    

Throws:
org.exolab.castor.xml.ValidationException if this object is an invalid instance according to the schema
    public void validate(
    )
        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
        validator.validate(this);
    }
New to GrepCode? Check out our FAQ X