Package java.lang

Examples of java.lang.IllegalArgumentException


     *
     * @param  type  new sort type
     **/
    public void setSortType(int type) {
        if (type != ASCENDING && type != DESCENDING) {
            throw new IllegalArgumentException("Invalid sort type (must be ASCENDING or DESCENDING).");
        }

        _sortType = type;

        sortAndUpdate();
View Full Code Here


     */
    public Spacer(int minWidth, int minHeight) {
        super(null);

        if (minWidth < 0 || minHeight < 0) {
             throw new IllegalArgumentException();
        }

        synchronized (Display.LCDUILock) {
            width  = minWidth;
            height = minHeight;
View Full Code Here

     * @throws IllegalArgumentException if either <code>minWidth</code>
     * or <code>minHeight</code> is less than zero
     */
    public void setMinimumSize(int minWidth, int minHeight) {
        if (minWidth < 0 || minHeight < 0) {
             throw new IllegalArgumentException();
        }

        synchronized (Display.LCDUILock) {
            width  = minWidth;
            height = minHeight;
View Full Code Here

       
        if (displayMode != -1) {
            throw new IllegalStateException("mode already set");
        }
        if (mode != USE_DIRECT_VIDEO && mode != USE_GUI_PRIMITIVE) {
            throw new IllegalArgumentException("unsupported mode");
        }
        if (mode == USE_DIRECT_VIDEO && !(container instanceof Canvas)) {
            throw new IllegalArgumentException("container needs to be a Canvas");
        }
        if (mode == USE_GUI_PRIMITIVE && container != null) {
            if (!(container instanceof String)) {
                throw new IllegalArgumentException("container not valid");
            }
            if (!(container.equals("javax.microedition.lcdui.Item"))) {
                throw new IllegalArgumentException("container not valid");
            }
        }

        if (mode == USE_DIRECT_VIDEO) {
            canvas = (Canvas)container;
View Full Code Here

        boolean sizeChanged = false;
       
        checkState();
        if (width < 1 || height < 1) {
            throw new IllegalArgumentException("invalid size");
        }

        synchronized(boundLock) {
            if (dw != width && dh != height) sizeChanged = true;
            dw = width;
View Full Code Here

  public RandomAccessFile(File file, String mode)
    throws FileNotFoundException
  {
    if (file == null) throw new NullPointerException();
    if (mode.equals("rw")) allowWrite = true;
    else if (! mode.equals("r")) throw new IllegalArgumentException();
    this.file = file;
    open();
  }
View Full Code Here

    return count;
  }
 
  public int read(byte b[], int off, int len) throws IOException {
    if(b == null)
    throw new IllegalArgumentException();
    if (peer == 0)
    throw new IOException();
  if(len == 0)
    return 0;
  if (position + len > this.length)
View Full Code Here

  return bytesRead;
  }
 
  public int read(byte b[]) throws IOException {
    if(b == null)
    throw new IllegalArgumentException();
    if (peer == 0)
    throw new IOException();
  if(b.length == 0)
    return 0;
  if (position + b.length > this.length)
View Full Code Here

  return bytesRead;
  }

  public void readFully(byte b[], int off, int len) throws IOException {
    if(b == null)
    throw new IllegalArgumentException();
    if (peer == 0)
    throw new IOException();
  if(len == 0)
    return;
  if (position + len > this.length)
View Full Code Here

        if(!(body instanceof MethodCall)) {
            if(log.isErrorEnabled()) log.error("message does not contain a MethodCall object");
           
            // create an exception to represent this and return it
            return  new IllegalArgumentException("message does not contain a MethodCall object") ;
        }

        method_call=(MethodCall)body;

        try {
View Full Code Here

TOP

Related Classes of java.lang.IllegalArgumentException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.