public boolean contains(Object o) {

        if (o == null)
            throw new NullPointerException("object can not be null");

        int read = this.readLocation;
        int write = this.writeLocation;


        if (read == write)
            return false;

        if (read < write) {

            for (int location = read; location < write; location++) {
                if (o.equals(data[location]))
                    return true;
            }

            return false;
        }

        for (int location = read; location < capacity; location++) {

            if (o.equals(data[location]))
                return true;
        }

        for (int location = 0; location < write; location++) {

            if (o.equals(data[location]))
                return true;
        }


        return false;
    }
public boolean contains ( Object o ) { if ( o == null ) throw new NullPointerException ( "object can not be null" ) ; int read = this . readLocation ; int write = this . writeLocation ; if ( read == write ) return false ; if ( read < write ) { for ( int location = read ; location < write ; location ++ ) { if ( o . equals ( data [ location ] ) ) return true ; } return false ; } for ( int location = read ; location < capacity ; location ++ ) { if ( o . equals ( data [ location ] ) ) return true ; } for ( int location = 0 ; location < write ; location ++ ) { if ( o . equals ( data [ location ] ) ) return true ; } return false ; }
Returns <tt>true</tt> if this queue contains the specified element.
More formally, returns <tt>true</tt> if and only if this queue contains
at least one element <tt>e</tt> such that <tt>o.equals(e)</tt>. The behavior of
this operation is undefined if modified while the operation is in progress.

@param o object to be checked for containment in this queue
@return <tt>true</tt> if this queue contains the specified element
@throws ClassCastException   if the class of the specified element
is incompatible with this queue
(<a href="../Collection.html#optional-restrictions">optional</a>)
@throws NullPointerException if the specified element is null
(<a href="../Collection.html#optional-restrictions">optional</a>)