opendap/src/main/java/opendap/dap/DArrayDimension.java
public void setProjection(int start, int stride, int stop) throws InvalidDimensionException
    {
        if(projection != null) {
            // See if we are changing start/stride/stop
          if(getSize() != start || getStride() != stride || getStop() != stop) {
            Formatter f = new Formatter();
            f.format(" [%d:%d:%d (%d)] != [%d:%d:%d (%d)]", start, stride, stop, projection.size, projection.start, projection.stride, projection.stop, projection.size);
            throw new ConstraintException("Implementation limitation: muliple references to same variable in single constraint: "+container.getLongName()+f.toString());
          }
        }

        String msg = "DArrayDimension.setProjection: Bad Projection Request: ";

        // validate the arguments

        if (start < 0)
            throw new InvalidDimensionException(msg + "start < 0");

        if (stride <= 0)
            throw new InvalidDimensionException(msg + "stride <= 0");

        if (stop < 0)
             throw new InvalidDimensionException(msg + "stop < 0");

        if (start < decl.start)
                   throw new InvalidDimensionException(msg + "start (" + start + ") < size (" + decl.size + ") for " + _nameClear);

        if (stop >= decl.size)
            throw new InvalidDimensionException(msg + "stop >= size: "+stop+":"+decl.size);


        if (stop < start)
            throw new InvalidDimensionException(msg + "stop < start");

        projection = new Slice(start,stride,stop);
    }
public void setProjection(int start, int stride, int stop) throws InvalidDimensionException
    {
        if(projection != null) {
            // See if we are changing start/stride/stop
          if(getSize() != start || getStride() != stride || getStop() != stop) {
            Formatter f = new Formatter();
            f.format(" [%d:%d:%d (%d)] != [%d:%d:%d (%d)]", start, stride, stop, projection.size, projection.start, projection.stride, projection.stop, projection.size);
            throw new ConstraintException("Implementation limitation: muliple references to same variable in single constraint: "+container.getLongName()+f.toString());
          }
        }

        String msg = "DArrayDimension.setProjection: Bad Projection Request: ";

        // validate the arguments

        if (start < 0)
            throw new InvalidDimensionException(msg + "start < 0");

        if (stride <= 0)
            throw new InvalidDimensionException(msg + "stride <= 0");

        if (stop < 0)
             throw new InvalidDimensionException(msg + "stop < 0");

        if (start < decl.start)
                   throw new InvalidDimensionException(msg + "start (" + start + ") < size (" + decl.size + ") for " + _nameClear);

        if (stop >= decl.size)
            throw new InvalidDimensionException(msg + "stop >= size: "+stop+":"+decl.size);


        if (stop < start)
            throw new InvalidDimensionException(msg + "stop < start");

        projection = new Slice(start,stride,stop);
    }
Set the projection information for this dimension.
The parameters <code>start</code> <code>stride</code> and <code>stop</code>
are checked to verify that they make sense relative to each other and to
the size of this dimension. If not an Invalid ParameterException is thrown.
The general rule is: 0&lt;=start&lt;size, 0&lt;stride, 0&lt;=stop&lt;size, start&lt;=stop.

@param start  The starting point for the projection of this <code>DArrayDimension</code>.
@param stride The size of the stride for the projection of this <code>DArrayDimension</code>.
@param stop   The stopping point for the projection of this <code>DArrayDimension</code>.