Skip to main content

UnsupportedOperationException

java.lang.UnsupportedOperationException

UnsupportedOperationException is described in the javadoc comments as:

Thrown to indicate that the requested operation is not supported.

This class is a member of the Java Collections Framework.
author: Josh Bloch version: 1.19, 12/19/03 since: 1.2

Where is this exception thrown?

Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown.

How is this exception thrown?

The following sub-sections identify where this exception is thrown, and how (or why) the code is throwing the exception.

Any source code quoted in this section is subject to the Java Research License unless stated otherwise.

com.sun.corba.se.impl.io.ObjectStreamClass.newInstance()

/**
     * Creates a new instance of the represented class.  If the class is
     * externalizable, invokes its public no-arg constructor; otherwise, if the
     * class is serializable, invokes the no-arg constructor of the first
     * non-serializable superclass.  Throws UnsupportedOperationException if
     * this class descriptor is not associated with a class, if the associated
     * class is non-serializable or if the appropriate no-arg constructor is
     * inaccessible/unavailable.
     */
Object newInstance() throws InstantiationException, InvocationTargetException, UnsupportedOperationException {
    if (cons != null) {
        try {
            return cons.newInstance(new Object[0]);
        } catch (IllegalAccessException ex) {
            InternalError ie = new InternalError();
            ie.initCause(ex);
            throw ie;
        }
    } else {
        throw new UnsupportedOperationException();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.corba.se.impl.ior.FreezableList.add(int, Object)

public void add(int index, Object element) {
    if (immutable) throw new UnsupportedOperationException();
    delegate.add(index, element);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.corba.se.impl.ior.FreezableList.remove(int)

public Object remove(int index) {
    if (immutable) throw new UnsupportedOperationException();
    return delegate.remove(index);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.corba.se.impl.ior.FreezableList.set(int, Object)

public Object set(int index, Object element) {
    if (immutable) throw new UnsupportedOperationException();
    return delegate.set(index, element);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.corba.se.impl.orb.DataCollectorBase.makeIterator(Enumeration)

private static Iterator makeIterator(final Enumeration enumeration) {
    return new Iterator() {

        public boolean hasNext() {
            return enumeration.hasMoreElements();
        }

        public Object next() {
            return enumeration.nextElement();
        }

        public void remove() {
            throw new UnsupportedOperationException();
        }
    };
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.corba.se.impl.transport.CorbaContactInfoListIteratorImpl.remove()

public void remove() {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.generic.InstructionList.iterator()

/**
   * @return Enumeration that lists all instructions (handles)
   */
public Iterator iterator() {
    return new Iterator() {

        private InstructionHandle ih = start;

        public Object next() {
            InstructionHandle i = ih;
            ih = ih.next;
            return i;
        }

        public void remove() {
            throw new UnsupportedOperationException();
        }

        public boolean hasNext() {
            return ih != null;
        }
    };
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.beancontext.BeanContextSupport.addAll(Collection)

/**
     * add Collection to set of Children (Unsupported)
     * implementations must synchronized on the hierarchy lock and 'children' protected field
     * @throws UnsupportedOperationException
     */
public boolean addAll(Collection c) {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.beancontext.BeanContextSupport.clear()

/**
     * clear the children (Unsupported)
     * implementations must synchronized on the hierarchy lock and 'children' protected field
     * @throws UnsupportedOperationException
     */
public void clear() {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.beancontext.BeanContextSupport.removeAll(Collection)

/**
     * remove all specified children (Unsupported)
     * implementations must synchronized on the hierarchy lock and 'children' protected field
     * @throws UnsupportedOperationException
     */
public boolean removeAll(Collection c) {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.beancontext.BeanContextSupport.retainAll(Collection)

/**
     * retain only specified children (Unsupported)
     * implementations must synchronized on the hierarchy lock and 'children' protected field
     * @throws UnsupportedOperationException
     */
public boolean retainAll(Collection c) {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.ObjectStreamClass.invokeReadObject(Object, ObjectInputStream)

/**
     * Invokes the readObject method of the represented serializable class.
     * Throws UnsupportedOperationException if this class descriptor is not
     * associated with a class, or if the class is externalizable,
     * non-serializable or does not define readObject.
     */
void invokeReadObject(Object obj, ObjectInputStream in) throws ClassNotFoundException, IOException, UnsupportedOperationException {
    if (readObjectMethod != null) {
        try {
            readObjectMethod.invoke(obj, new Object[] { in });
        } catch (InvocationTargetException ex) {
            Throwable th = ex.getTargetException();
            if (th instanceof ClassNotFoundException) {
                throw (ClassNotFoundException) th;
            } else if (th instanceof IOException) {
                throw (IOException) th;
            } else {
                throwMiscException(th);
            }
        } catch (IllegalAccessException ex) {
            throw new InternalError();
        }
    } else {
        throw new UnsupportedOperationException();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.ObjectStreamClass.invokeReadObjectNoData(Object)

/**
     * Invokes the readObjectNoData method of the represented serializable
     * class.  Throws UnsupportedOperationException if this class descriptor is
     * not associated with a class, or if the class is externalizable,
     * non-serializable or does not define readObjectNoData.
     */
void invokeReadObjectNoData(Object obj) throws IOException, UnsupportedOperationException {
    if (readObjectNoDataMethod != null) {
        try {
            readObjectNoDataMethod.invoke(obj, null);
        } catch (InvocationTargetException ex) {
            Throwable th = ex.getTargetException();
            if (th instanceof ObjectStreamException) {
                throw (ObjectStreamException) th;
            } else {
                throwMiscException(th);
            }
        } catch (IllegalAccessException ex) {
            throw new InternalError();
        }
    } else {
        throw new UnsupportedOperationException();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.ObjectStreamClass.invokeReadResolve(Object)

/**
     * Invokes the readResolve method of the represented serializable class and
     * returns the result.  Throws UnsupportedOperationException if this class
     * descriptor is not associated with a class, or if the class is
     * non-serializable or does not define readResolve.
     */
Object invokeReadResolve(Object obj) throws IOException, UnsupportedOperationException {
    if (readResolveMethod != null) {
        try {
            return readResolveMethod.invoke(obj, null);
        } catch (InvocationTargetException ex) {
            Throwable th = ex.getTargetException();
            if (th instanceof ObjectStreamException) {
                throw (ObjectStreamException) th;
            } else {
                throwMiscException(th);
                throw new InternalError();
            }
        } catch (IllegalAccessException ex) {
            throw new InternalError();
        }
    } else {
        throw new UnsupportedOperationException();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.ObjectStreamClass.invokeWriteObject(Object, ObjectOutputStream)

/**
     * Invokes the writeObject method of the represented serializable class.
     * Throws UnsupportedOperationException if this class descriptor is not
     * associated with a class, or if the class is externalizable,
     * non-serializable or does not define writeObject.
     */
void invokeWriteObject(Object obj, ObjectOutputStream out) throws IOException, UnsupportedOperationException {
    if (writeObjectMethod != null) {
        try {
            writeObjectMethod.invoke(obj, new Object[] { out });
        } catch (InvocationTargetException ex) {
            Throwable th = ex.getTargetException();
            if (th instanceof IOException) {
                throw (IOException) th;
            } else {
                throwMiscException(th);
            }
        } catch (IllegalAccessException ex) {
            throw new InternalError();
        }
    } else {
        throw new UnsupportedOperationException();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.ObjectStreamClass.invokeWriteReplace(Object)

/**
     * Invokes the writeReplace method of the represented serializable class and
     * returns the result.  Throws UnsupportedOperationException if this class
     * descriptor is not associated with a class, or if the class is
     * non-serializable or does not define writeReplace.
     */
Object invokeWriteReplace(Object obj) throws IOException, UnsupportedOperationException {
    if (writeReplaceMethod != null) {
        try {
            return writeReplaceMethod.invoke(obj, null);
        } catch (InvocationTargetException ex) {
            Throwable th = ex.getTargetException();
            if (th instanceof ObjectStreamException) {
                throw (ObjectStreamException) th;
            } else {
                throwMiscException(th);
                throw new InternalError();
            }
        } catch (IllegalAccessException ex) {
            throw new InternalError();
        }
    } else {
        throw new UnsupportedOperationException();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.ObjectStreamClass.newInstance()

/**
     * Creates a new instance of the represented class.  If the class is
     * externalizable, invokes its public no-arg constructor; otherwise, if the
     * class is serializable, invokes the no-arg constructor of the first
     * non-serializable superclass.  Throws UnsupportedOperationException if
     * this class descriptor is not associated with a class, if the associated
     * class is non-serializable or if the appropriate no-arg constructor is
     * inaccessible/unavailable.
     */
Object newInstance() throws InstantiationException, InvocationTargetException, UnsupportedOperationException {
    if (cons != null) {
        try {
            return cons.newInstance(null);
        } catch (IllegalAccessException ex) {
            throw new InternalError();
        }
    } else {
        throw new UnsupportedOperationException();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.ThreadLocal.childValue(T)

/**
     * Method childValue is visibly defined in subclass
     * InheritableThreadLocal, but is internally defined here for the
     * sake of providing createInheritedMap factory method without
     * needing to subclass the map class in InheritableThreadLocal.
     * This technique is preferable to the alternative of embedding
     * instanceof tests in methods.
     */
T childValue(T parentValue) {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.net.MulticastSocket.joinGroup(SocketAddress, NetworkInterface)

/**
     * Joins the specified multicast group at the specified interface.
     * If there is a security manager, this method first
     * calls its <code>checkMulticast</code> method
     * with the <code>mcastaddr</code> argument
     * as its argument.
     * @param mcastaddr is the multicast address to join
     * @param netIf specifies the local interface to receive multicast
     *        datagram packets, or <i>null</i> to defer to the interface set by
     *      {@link MulticastSocket#setInterface(InetAddress)} or 
     *      {@link MulticastSocket#setNetworkInterface(NetworkInterface)}
     * @exception IOException if there is an error joining
     * or when the address is not a multicast address.
     * @exception  SecurityException  if a security manager exists and its  
     * <code>checkMulticast</code> method doesn't allow the join.
     * @throws  IllegalArgumentException if mcastaddr is null or is a
     *          SocketAddress subclass not supported by this socket
     * @see SecurityManager#checkMulticast(InetAddress)
     * @since 1.4
     */
public void joinGroup(SocketAddress mcastaddr, NetworkInterface netIf) throws IOException {
    if (isClosed()) throw new SocketException('Socket is closed');
    if (mcastaddr == null || !(mcastaddr instanceof InetSocketAddress)) throw new IllegalArgumentException('Unsupported address type');
    if (oldImpl) throw new UnsupportedOperationException();
    SecurityManager security = System.getSecurityManager();
    if (security != null) {
        security.checkMulticast(((InetSocketAddress) mcastaddr).getAddress());
    }
    if (!((InetSocketAddress) mcastaddr).getAddress().isMulticastAddress()) {
        throw new SocketException('Not a multicast address');
    }
    getImpl().joinGroup(mcastaddr, netIf);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.net.MulticastSocket.leaveGroup(SocketAddress, NetworkInterface)

/**
     * Leave a multicast group on a specified local interface.
     * If there is a security manager, this method first
     * calls its <code>checkMulticast</code> method
     * with the <code>mcastaddr</code> argument
     * as its argument.
     * @param mcastaddr is the multicast address to leave
     * @param netIf specifies the local interface or <i>null</i> to defer
     *     to the interface set by
     *     {@link MulticastSocket#setInterface(InetAddress)} or 
     *     {@link MulticastSocket#setNetworkInterface(NetworkInterface)}
     * @exception IOException if there is an error leaving
     * or when the address is not a multicast address.
     * @exception  SecurityException  if a security manager exists and its  
     * <code>checkMulticast</code> method doesn't allow the operation.
     * @throws  IllegalArgumentException if mcastaddr is null or is a
     *          SocketAddress subclass not supported by this socket
     * @see SecurityManager#checkMulticast(InetAddress)
     * @since 1.4
     */
public void leaveGroup(SocketAddress mcastaddr, NetworkInterface netIf) throws IOException {
    if (isClosed()) throw new SocketException('Socket is closed');
    if (mcastaddr == null || !(mcastaddr instanceof InetSocketAddress)) throw new IllegalArgumentException('Unsupported address type');
    if (oldImpl) throw new UnsupportedOperationException();
    SecurityManager security = System.getSecurityManager();
    if (security != null) {
        security.checkMulticast(((InetSocketAddress) mcastaddr).getAddress());
    }
    if (!((InetSocketAddress) mcastaddr).getAddress().isMulticastAddress()) {
        throw new SocketException('Not a multicast address');
    }
    getImpl().leaveGroup(mcastaddr, netIf);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.ByteBuffer.array()

/**
     * Returns the byte array that backs this
     * buffer  <i>(optional operation)</i>.
     *  Modifications to this buffer's content will cause the returned
     * array's content to be modified, and vice versa.
     *  Invoke the {@link #hasArray hasArray} method before invoking this
     * method in order to ensure that this buffer has an accessible backing
     * array.  
     * @return  The array that backs this buffer
     * @throws  ReadOnlyBufferException
     *          If this buffer is backed by an array but is read-only
     * @throws  UnsupportedOperationException
     *          If this buffer is not backed by an accessible array
     */
public final byte[] array() {
    if (hb == null) throw new UnsupportedOperationException();
    if (isReadOnly) throw new ReadOnlyBufferException();
    return hb;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.ByteBuffer.arrayOffset()

/**
     * Returns the offset within this buffer's backing array of the first
     * element of the buffer  <i>(optional operation)</i>.
     *  If this buffer is backed by an array then buffer position <i>p</i>
     * corresponds to array index <i>p</i> + <tt>arrayOffset()</tt>.
     *  Invoke the {@link #hasArray hasArray} method before invoking this
     * method in order to ensure that this buffer has an accessible backing
     * array.  
     * @return  The offset within this buffer's array
     *          of the first element of the buffer
     * @throws  ReadOnlyBufferException
     *          If this buffer is backed by an array but is read-only
     * @throws  UnsupportedOperationException
     *          If this buffer is not backed by an accessible array
     */
public final int arrayOffset() {
    if (hb == null) throw new UnsupportedOperationException();
    if (isReadOnly) throw new ReadOnlyBufferException();
    return offset;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.CharBuffer.array()

/**
     * Returns the character array that backs this
     * buffer  <i>(optional operation)</i>.
     *  Modifications to this buffer's content will cause the returned
     * array's content to be modified, and vice versa.
     *  Invoke the {@link #hasArray hasArray} method before invoking this
     * method in order to ensure that this buffer has an accessible backing
     * array.  
     * @return  The array that backs this buffer
     * @throws  ReadOnlyBufferException
     *          If this buffer is backed by an array but is read-only
     * @throws  UnsupportedOperationException
     *          If this buffer is not backed by an accessible array
     */
public final char[] array() {
    if (hb == null) throw new UnsupportedOperationException();
    if (isReadOnly) throw new ReadOnlyBufferException();
    return hb;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.CharBuffer.arrayOffset()

/**
     * Returns the offset within this buffer's backing array of the first
     * element of the buffer  <i>(optional operation)</i>.
     *  If this buffer is backed by an array then buffer position <i>p</i>
     * corresponds to array index <i>p</i> + <tt>arrayOffset()</tt>.
     *  Invoke the {@link #hasArray hasArray} method before invoking this
     * method in order to ensure that this buffer has an accessible backing
     * array.  
     * @return  The offset within this buffer's array
     *          of the first element of the buffer
     * @throws  ReadOnlyBufferException
     *          If this buffer is backed by an array but is read-only
     * @throws  UnsupportedOperationException
     *          If this buffer is not backed by an accessible array
     */
public final int arrayOffset() {
    if (hb == null) throw new UnsupportedOperationException();
    if (isReadOnly) throw new ReadOnlyBufferException();
    return offset;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.DoubleBuffer.array()

/**
     * Returns the double array that backs this
     * buffer  <i>(optional operation)</i>.
     *  Modifications to this buffer's content will cause the returned
     * array's content to be modified, and vice versa.
     *  Invoke the {@link #hasArray hasArray} method before invoking this
     * method in order to ensure that this buffer has an accessible backing
     * array.  
     * @return  The array that backs this buffer
     * @throws  ReadOnlyBufferException
     *          If this buffer is backed by an array but is read-only
     * @throws  UnsupportedOperationException
     *          If this buffer is not backed by an accessible array
     */
public final double[] array() {
    if (hb == null) throw new UnsupportedOperationException();
    if (isReadOnly) throw new ReadOnlyBufferException();
    return hb;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.DoubleBuffer.arrayOffset()

/**
     * Returns the offset within this buffer's backing array of the first
     * element of the buffer  <i>(optional operation)</i>.
     *  If this buffer is backed by an array then buffer position <i>p</i>
     * corresponds to array index <i>p</i> + <tt>arrayOffset()</tt>.
     *  Invoke the {@link #hasArray hasArray} method before invoking this
     * method in order to ensure that this buffer has an accessible backing
     * array.  
     * @return  The offset within this buffer's array
     *          of the first element of the buffer
     * @throws  ReadOnlyBufferException
     *          If this buffer is backed by an array but is read-only
     * @throws  UnsupportedOperationException
     *          If this buffer is not backed by an accessible array
     */
public final int arrayOffset() {
    if (hb == null) throw new UnsupportedOperationException();
    if (isReadOnly) throw new ReadOnlyBufferException();
    return offset;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.FloatBuffer.array()

/**
     * Returns the float array that backs this
     * buffer  <i>(optional operation)</i>.
     *  Modifications to this buffer's content will cause the returned
     * array's content to be modified, and vice versa.
     *  Invoke the {@link #hasArray hasArray} method before invoking this
     * method in order to ensure that this buffer has an accessible backing
     * array.  
     * @return  The array that backs this buffer
     * @throws  ReadOnlyBufferException
     *          If this buffer is backed by an array but is read-only
     * @throws  UnsupportedOperationException
     *          If this buffer is not backed by an accessible array
     */
public final float[] array() {
    if (hb == null) throw new UnsupportedOperationException();
    if (isReadOnly) throw new ReadOnlyBufferException();
    return hb;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.FloatBuffer.arrayOffset()

/**
     * Returns the offset within this buffer's backing array of the first
     * element of the buffer  <i>(optional operation)</i>.
     *  If this buffer is backed by an array then buffer position <i>p</i>
     * corresponds to array index <i>p</i> + <tt>arrayOffset()</tt>.
     *  Invoke the {@link #hasArray hasArray} method before invoking this
     * method in order to ensure that this buffer has an accessible backing
     * array.  
     * @return  The offset within this buffer's array
     *          of the first element of the buffer
     * @throws  ReadOnlyBufferException
     *          If this buffer is backed by an array but is read-only
     * @throws  UnsupportedOperationException
     *          If this buffer is not backed by an accessible array
     */
public final int arrayOffset() {
    if (hb == null) throw new UnsupportedOperationException();
    if (isReadOnly) throw new ReadOnlyBufferException();
    return offset;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.IntBuffer.array()

/**
     * Returns the int array that backs this
     * buffer  <i>(optional operation)</i>.
     *  Modifications to this buffer's content will cause the returned
     * array's content to be modified, and vice versa.
     *  Invoke the {@link #hasArray hasArray} method before invoking this
     * method in order to ensure that this buffer has an accessible backing
     * array.  
     * @return  The array that backs this buffer
     * @throws  ReadOnlyBufferException
     *          If this buffer is backed by an array but is read-only
     * @throws  UnsupportedOperationException
     *          If this buffer is not backed by an accessible array
     */
public final int[] array() {
    if (hb == null) throw new UnsupportedOperationException();
    if (isReadOnly) throw new ReadOnlyBufferException();
    return hb;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.IntBuffer.arrayOffset()

/**
     * Returns the offset within this buffer's backing array of the first
     * element of the buffer  <i>(optional operation)</i>.
     *  If this buffer is backed by an array then buffer position <i>p</i>
     * corresponds to array index <i>p</i> + <tt>arrayOffset()</tt>.
     *  Invoke the {@link #hasArray hasArray} method before invoking this
     * method in order to ensure that this buffer has an accessible backing
     * array.  
     * @return  The offset within this buffer's array
     *          of the first element of the buffer
     * @throws  ReadOnlyBufferException
     *          If this buffer is backed by an array but is read-only
     * @throws  UnsupportedOperationException
     *          If this buffer is not backed by an accessible array
     */
public final int arrayOffset() {
    if (hb == null) throw new UnsupportedOperationException();
    if (isReadOnly) throw new ReadOnlyBufferException();
    return offset;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.LongBuffer.array()

/**
     * Returns the long array that backs this
     * buffer  <i>(optional operation)</i>.
     *  Modifications to this buffer's content will cause the returned
     * array's content to be modified, and vice versa.
     *  Invoke the {@link #hasArray hasArray} method before invoking this
     * method in order to ensure that this buffer has an accessible backing
     * array.  
     * @return  The array that backs this buffer
     * @throws  ReadOnlyBufferException
     *          If this buffer is backed by an array but is read-only
     * @throws  UnsupportedOperationException
     *          If this buffer is not backed by an accessible array
     */
public final long[] array() {
    if (hb == null) throw new UnsupportedOperationException();
    if (isReadOnly) throw new ReadOnlyBufferException();
    return hb;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.LongBuffer.arrayOffset()

/**
     * Returns the offset within this buffer's backing array of the first
     * element of the buffer  <i>(optional operation)</i>.
     *  If this buffer is backed by an array then buffer position <i>p</i>
     * corresponds to array index <i>p</i> + <tt>arrayOffset()</tt>.
     *  Invoke the {@link #hasArray hasArray} method before invoking this
     * method in order to ensure that this buffer has an accessible backing
     * array.  
     * @return  The offset within this buffer's array
     *          of the first element of the buffer
     * @throws  ReadOnlyBufferException
     *          If this buffer is backed by an array but is read-only
     * @throws  UnsupportedOperationException
     *          If this buffer is not backed by an accessible array
     */
public final int arrayOffset() {
    if (hb == null) throw new UnsupportedOperationException();
    if (isReadOnly) throw new ReadOnlyBufferException();
    return offset;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.MappedByteBuffer.checkMapped()

private void checkMapped() {
    if (!isAMappedBuffer) throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.ShortBuffer.array()

/**
     * Returns the short array that backs this
     * buffer  <i>(optional operation)</i>.
     *  Modifications to this buffer's content will cause the returned
     * array's content to be modified, and vice versa.
     *  Invoke the {@link #hasArray hasArray} method before invoking this
     * method in order to ensure that this buffer has an accessible backing
     * array.  
     * @return  The array that backs this buffer
     * @throws  ReadOnlyBufferException
     *          If this buffer is backed by an array but is read-only
     * @throws  UnsupportedOperationException
     *          If this buffer is not backed by an accessible array
     */
public final short[] array() {
    if (hb == null) throw new UnsupportedOperationException();
    if (isReadOnly) throw new ReadOnlyBufferException();
    return hb;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.ShortBuffer.arrayOffset()

/**
     * Returns the offset within this buffer's backing array of the first
     * element of the buffer  <i>(optional operation)</i>.
     *  If this buffer is backed by an array then buffer position <i>p</i>
     * corresponds to array index <i>p</i> + <tt>arrayOffset()</tt>.
     *  Invoke the {@link #hasArray hasArray} method before invoking this
     * method in order to ensure that this buffer has an accessible backing
     * array.  
     * @return  The offset within this buffer's array
     *          of the first element of the buffer
     * @throws  ReadOnlyBufferException
     *          If this buffer is backed by an array but is read-only
     * @throws  UnsupportedOperationException
     *          If this buffer is not backed by an accessible array
     */
public final int arrayOffset() {
    if (hb == null) throw new UnsupportedOperationException();
    if (isReadOnly) throw new ReadOnlyBufferException();
    return offset;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.charset.Charset.providers()

private static Iterator providers() {
    return new Iterator() {

        Class c = java.nio.charset.spi.CharsetProvider.class;

        ClassLoader cl = ClassLoader.getSystemClassLoader();

        Iterator i = Service.providers(c, cl);

        Object next = null;

        private boolean getNext() {
            while (next == null) {
                try {
                    if (!i.hasNext()) return false;
                    next = i.next();
                } catch (ServiceConfigurationError sce) {
                    if (sce.getCause() instanceof SecurityException) {
                        continue;
                    }
                    throw sce;
                }
            }
            return true;
        }

        public boolean hasNext() {
            return getNext();
        }

        public Object next() {
            if (!getNext()) throw new NoSuchElementException();
            Object n = next;
            next = null;
            return n;
        }

        public void remove() {
            throw new UnsupportedOperationException();
        }
    };
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.charset.CharsetDecoder.detectedCharset()

/**
     * Retrieves the charset that was detected by this
     * decoder  <i>(optional operation)</i>.
     *  If this decoder implements an auto-detecting charset then this
     * method returns the actual charset once it has been detected.  After that
     * point, this method returns the same value for the duration of the
     * current decoding operation.  If not enough input bytes have yet been
     * read to determine the actual charset then this method throws an {@link
     * IllegalStateException}.
     *  The default implementation of this method always throws an {@link
     * UnsupportedOperationException}; it should be overridden by
     * auto-detecting decoders to return the appropriate value.  
     * @return  The charset detected by this auto-detecting decoder,
     *          or <tt>null</tt> if the charset has not yet been determined
     * @throws  IllegalStateException
     *          If insufficient bytes have been read to determine a charset
     * @throws  UnsupportedOperationException
     *          If this decoder does not implement an auto-detecting charset
     */
public Charset detectedCharset() {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.charset.CharsetDecoder.isCharsetDetected()

/**
     * Tells whether or not this decoder has yet detected a
     * charset  <i>(optional operation)</i>.
     *  If this decoder implements an auto-detecting charset then at a
     * single point during a decoding operation this method may start returning
     * <tt>true</tt> to indicate that a specific charset has been detected in
     * the input byte sequence.  Once this occurs, the {@link #detectedCharset
     * detectedCharset} method may be invoked to retrieve the detected charset.
     *  That this method returns <tt>false</tt> does not imply that no bytes
     * have yet been decoded.  Some auto-detecting decoders are capable of
     * decoding some, or even all, of an input byte sequence without fixing on
     * a particular charset.
     *  The default implementation of this method always throws an {@link
     * UnsupportedOperationException}; it should be overridden by
     * auto-detecting decoders to return <tt>true</tt> once the input charset
     * has been determined.  
     * @return  <tt>true</tt> if, and only if, this decoder has detected a
     *          specific charset
     * @throws  UnsupportedOperationException
     *          If this decoder does not implement an auto-detecting charset
     */
public boolean isCharsetDetected() {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.nio.charset.CoderResult.length()

/**
     * Returns the length of the erroneous input described by this
     * object  <i>(optional operation)</i>.  
     * @return  The length of the erroneous input, a positive integer
     * @throws  UnsupportedOperationException
     *          If this object does not describe an error condition, that is,
     *          if the {@link #isError() isError} does not return <tt>true</tt>
     */
public int length() {
    if (!isError()) throw new UnsupportedOperationException();
    return length;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.rmi.server.RemoteStub.setRef(RemoteStub, RemoteRef)

/**
     * Sets the remote reference inside the remote stub.
     * @param stub the remote stub
     * @param ref the remote reference
     * @since JDK1.1
     * @deprecated no replacement.  The <code>setRef</code> method
     * is not needed since <code>RemoteStub</code>s can be created with
     * the <code>RemoteStub(RemoteRef)</code> constructor.
     */
@Deprecated
protected static void setRef(RemoteStub stub, RemoteRef ref) {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.KeyPairGeneratorSpi.initialize(AlgorithmParameterSpec, SecureRandom)

/**
     * Initializes the key pair generator using the specified parameter
     * set and user-provided source of randomness.
     * This concrete method has been added to this previously-defined
     * abstract class. (For backwards compatibility, it cannot be abstract.)
     * It may be overridden by a provider to initialize the key pair 
     * generator. Such an override
     * is expected to throw an InvalidAlgorithmParameterException if
     * a parameter is inappropriate for this key pair generator.
     * If this method is not overridden, it always throws an
     * UnsupportedOperationException.
     * @param params the parameter set used to generate the keys.
     * @param random the source of randomness for this generator.
     * @exception InvalidAlgorithmParameterException if the given parameters
     * are inappropriate for this key pair generator.
     * @since 1.2
     */
public void initialize(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.KeyStoreSpi.engineGetEntry(String, KeyStore.ProtectionParameter)

/**
     * Gets a <code>KeyStore.Entry</code> for the specified alias
     * with the specified protection parameter.
     * @param alias get the <code>KeyStore.Entry</code> for this alias
     * @param protParam the <code>ProtectionParameter</code>
     *  used to protect the <code>Entry</code>,
     *  which may be <code>null</code>
     * @return the <code>KeyStore.Entry</code> for the specified alias,
     *  or <code>null</code> if there is no such entry
     * @exception KeyStoreException if the operation failed
     * @exception NoSuchAlgorithmException if the algorithm for recovering the
     *  entry cannot be found
     * @exception UnrecoverableEntryException if the specified
     *  <code>protParam</code> were insufficient or invalid
     * @since 1.5
     */
public KeyStore.Entry engineGetEntry(String alias, KeyStore.ProtectionParameter protParam) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableEntryException {
    if (!engineContainsAlias(alias)) {
        return null;
    }
    if (protParam == null) {
        if (engineIsCertificateEntry(alias)) {
            return new KeyStore.TrustedCertificateEntry(engineGetCertificate(alias));
        } else {
            throw new UnrecoverableEntryException('requested entry requires a password');
        }
    }
    if (protParam instanceof KeyStore.PasswordProtection) {
        if (engineIsCertificateEntry(alias)) {
            throw new UnsupportedOperationException('trusted certificate entries are not password-protected');
        } else if (engineIsKeyEntry(alias)) {
            KeyStore.PasswordProtection pp = (KeyStore.PasswordProtection) protParam;
            char[] password = pp.getPassword();
            try {
                Key key = engineGetKey(alias, password);
                if (key instanceof PrivateKey) {
                    Certificate[] chain = engineGetCertificateChain(alias);
                    return new KeyStore.PrivateKeyEntry((PrivateKey) key, chain);
                } else if (key instanceof SecretKey) {
                    return new KeyStore.SecretKeyEntry((SecretKey) key);
                }
            } catch (UnrecoverableKeyException uke) {
                UnrecoverableEntryException uee = new UnrecoverableEntryException();
                uee.initCause(uke);
                throw uee;
            }
        }
    }
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.KeyStoreSpi.engineLoad(KeyStore.LoadStoreParameter)

/**
     * Loads the keystore using the given
     * <code>KeyStore.LoadStoreParameter</code>.
     *  Note that if this KeyStore has already been loaded, it is
     * reinitialized and loaded again from the given parameter.
     * @param param the <code>KeyStore.LoadStoreParameter</code>
     *  that specifies how to load the keystore,
     *  which may be <code>null</code>
     * @exception IllegalArgumentException if the given
     *  <code>KeyStore.LoadStoreParameter</code>
     *  input is not recognized
     * @exception IOException if there is an I/O or format problem with the
     *  keystore data
     * @exception NoSuchAlgorithmException if the algorithm used to check
     *  the integrity of the keystore cannot be found
     * @exception CertificateException if any of the certificates in the
     *  keystore could not be loaded
     * @since 1.5
     */
public void engineLoad(KeyStore.LoadStoreParameter param) throws IOException, NoSuchAlgorithmException, CertificateException {
    if (param == null) {
        engineLoad((InputStream) null, (char[]) null);
        return;
    }
    if (param instanceof KeyStore.SimpleLoadStoreParameter) {
        ProtectionParameter protection = param.getProtectionParameter();
        char[] password;
        if (protection instanceof PasswordProtection) {
            password = ((PasswordProtection) param).getPassword();
        } else if (protection instanceof CallbackHandlerProtection) {
            CallbackHandler handler = ((CallbackHandlerProtection) param).getCallbackHandler();
            PasswordCallback callback = new PasswordCallback('Password: ', false);
            try {
                handler.handle(new Callback[] { callback });
            } catch (UnsupportedCallbackException e) {
                throw new NoSuchAlgorithmException('Could not obtain password', e);
            }
            password = callback.getPassword();
            callback.clearPassword();
            if (password == null) {
                throw new NoSuchAlgorithmException('No password provided');
            }
        } else {
            throw new NoSuchAlgorithmException('ProtectionParameter must' + ' be PasswordProtection or CallbackHandlerProtection');
        }
        engineLoad(null, password);
        return;
    }
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.KeyStoreSpi.engineStore(KeyStore.LoadStoreParameter)

/**
     * Stores this keystore using the given
     * <code>KeyStore.LoadStoreParmeter</code>.
     * @param param the <code>KeyStore.LoadStoreParmeter</code>
     *  that specifies how to store the keystore,
     *  which may be <code>null</code>
     * @exception IllegalArgumentException if the given
     *  <code>KeyStore.LoadStoreParmeter</code>
     *  input is not recognized
     * @exception IOException if there was an I/O problem with data
     * @exception NoSuchAlgorithmException if the appropriate data integrity
     *  algorithm could not be found
     * @exception CertificateException if any of the certificates included in
     *  the keystore data could not be stored
     * @since 1.5
     */
public void engineStore(KeyStore.LoadStoreParameter param) throws IOException, NoSuchAlgorithmException, CertificateException {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.SignatureSpi.engineGetParameters()

/**
     * This method is overridden by providers to return the
     * parameters used with this signature engine, or null 
     * if this signature engine does not use any parameters.
     * The returned parameters may be the same that were used to initialize
     * this signature engine, or may contain a combination of default and 
     * randomly generated parameter values used by the underlying signature
     * implementation if this signature engine requires algorithm parameters 
     * but was not initialized with any.
     * @return the parameters used with this signature engine, or null if this
     * signature engine does not use any parameters
     * @exception UnsupportedOperationException if this method is
     * not overridden by a provider
     */
protected AlgorithmParameters engineGetParameters() {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.SignatureSpi.engineSetParameter(AlgorithmParameterSpec)

/**
     * This method is overridden by providers to initialize
     * this signature engine with the specified parameter set.
     * @param params the parameters
     * @exception UnsupportedOperationException if this method is not
     * overridden by a provider
     * @exception InvalidAlgorithmParameterException if this method is
     * overridden by a provider and the the given parameters
     * are inappropriate for this signature engine
     */
protected void engineSetParameter(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.cert.CertificateFactorySpi.engineGenerateCertPath(InputStream)

/**
     * Generates a <code>CertPath</code> object and initializes it with
     * the data read from the <code>InputStream</code> inStream. The data
     * is assumed to be in the default encoding.
     *  This method was added to version 1.4 of the Java 2 Platform
     * Standard Edition. In order to maintain backwards compatibility with
     * existing service providers, this method cannot be <code>abstract</code>
     * and by default throws an <code>UnsupportedOperationException</code>.
     * @param inStream an <code>InputStream</code> containing the data
     * @return a <code>CertPath</code> initialized with the data from the
     *   <code>InputStream</code>
     * @exception CertificateException if an exception occurs while decoding
     * @exception UnsupportedOperationException if the method is not supported
     * @since 1.4
     */
public CertPath engineGenerateCertPath(InputStream inStream) throws CertificateException {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.cert.CertificateFactorySpi.engineGenerateCertPath(InputStream, String)

/**
     * Generates a <code>CertPath</code> object and initializes it with
     * the data read from the <code>InputStream</code> inStream. The data
     * is assumed to be in the specified encoding.
     *  This method was added to version 1.4 of the Java 2 Platform
     * Standard Edition. In order to maintain backwards compatibility with
     * existing service providers, this method cannot be <code>abstract</code>
     * and by default throws an <code>UnsupportedOperationException</code>.
     * @param inStream an <code>InputStream</code> containing the data
     * @param encoding the encoding used for the data
     * @return a <code>CertPath</code> initialized with the data from the
     *   <code>InputStream</code>
     * @exception CertificateException if an exception occurs while decoding or
     *   the encoding requested is not supported
     * @exception UnsupportedOperationException if the method is not supported
     * @since 1.4
     */
public CertPath engineGenerateCertPath(InputStream inStream, String encoding) throws CertificateException {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.cert.CertificateFactorySpi.engineGetCertPathEncodings()

/**
     * Returns an iteration of the <code>CertPath</code> encodings supported 
     * by this certificate factory, with the default encoding first. See 
     * Appendix A in the 
     * <a href='../../../../guide/security/certpath/CertPathProgGuide.html#AppA'>
     * Java Certification Path API Programmer's Guide</a>
     * for information about standard encoding names.
     * Attempts to modify the returned <code>Iterator</code> via its
     * <code>remove</code> method result in an
     * <code>UnsupportedOperationException</code>.
     *  This method was added to version 1.4 of the Java 2 Platform
     * Standard Edition. In order to maintain backwards compatibility with
     * existing service providers, this method cannot be <code>abstract</code>
     * and by default throws an <code>UnsupportedOperationException</code>.
     * @return an <code>Iterator</code> over the names of the supported
     *         <code>CertPath</code> encodings (as <code>String</code>s)
     * @exception UnsupportedOperationException if the method is not supported
     * @since 1.4
     */
public Iterator<String> engineGetCertPathEncodings() {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.text.AttributedString.setValue(Object)

public Object setValue(Object newValue) {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.text.NumberFormat.getCurrency()

/**
     * Gets the currency used by this number format when formatting
     * currency values. The initial value is derived in a locale dependent
     * way. The returned value may be null if no valid
     * currency could be determined and no currency has been set using
     * {@link #setCurrency(java.util.Currency) setCurrency}.
     * The default implementation throws
     * <code>UnsupportedOperationException</code>.
     * @return the currency used by this number format, or <code>null</code>
     * @exception UnsupportedOperationException if the number format class
     * doesn't implement currency formatting
     * @since 1.4
     */
public Currency getCurrency() {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.text.NumberFormat.setCurrency(Currency)

/**
     * Sets the currency used by this number format when formatting
     * currency values. This does not update the minimum or maximum
     * number of fraction digits used by the number format.
     * The default implementation throws
     * <code>UnsupportedOperationException</code>.
     * @param currency the new currency to be used by this number format
     * @exception UnsupportedOperationException if the number format class
     * doesn't implement currency formatting
     * @exception NullPointerException if <code>currency</code> is null
     * @since 1.4
     */
public void setCurrency(Currency currency) {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.AbstractCollection.add(E)

/**
     * Ensures that this collection contains the specified element (optional
     * operation).  Returns <tt>true</tt> if the collection changed as a
     * result of the call.  (Returns <tt>false</tt> if this collection does
     * not permit duplicates and already contains the specified element.)
     * Collections that support this operation may place limitations on what
     * elements may be added to the collection.  In particular, some
     * collections will refuse to add <tt>null</tt> elements, and others will
     * impose restrictions on the type of elements that may be added.
     * Collection classes should clearly specify in their documentation any
     * restrictions on what elements may be added.
     * This implementation always throws an
     * <tt>UnsupportedOperationException</tt>.
     * @param o element whose presence in this collection is to be ensured.
     * @return <tt>true</tt> if the collection changed as a result of the call.
     * @throws UnsupportedOperationException if the <tt>add</tt> method is not
     *    supported by this collection.
     * @throws NullPointerException if this collection does not permit
     *     <tt>null</tt> elements, and the specified element is
     *     <tt>null</tt>.
     * @throws ClassCastException if the class of the specified element
     *     prevents it from being added to this collection.
     * @throws IllegalArgumentException if some aspect of this element
     *            prevents it from being added to this collection.
     */
public boolean add(E o) {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.AbstractList.add(int, E)

/**
     * Inserts the specified element at the specified position in this list
     * (optional operation).  Shifts the element currently at that position
     * (if any) and any subsequent elements to the right (adds one to their
     * indices).
     * This implementation always throws an UnsupportedOperationException.
     * @param index index at which the specified element is to be inserted.
     * @param element element to be inserted.
     * @throws UnsupportedOperationException if the <tt>add</tt> method is not
     *    supported by this list.
     * @throws ClassCastException if the class of the specified element
     *     prevents it from being added to this list.
     * @throws IllegalArgumentException if some aspect of the specified
     *    element prevents it from being added to this list.
     * @throws IndexOutOfBoundsException index is out of range (<tt>index <
     *    0 || index > size()</tt>).
     */
public void add(int index, E element) {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.AbstractList.add(int, E)

public void add(int index, E element) {
    if (index < 0 || index > size) throw new IndexOutOfBoundsException();
    checkForComodification();
    l.add(index + offset, element);
    expectedModCount = l.modCount;
    size++;
    modCount++;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.AbstractList.remove(int)

/**
     * Removes the element at the specified position in this list (optional
     * operation).  Shifts any subsequent elements to the left (subtracts one
     * from their indices).  Returns the element that was removed from the
     * list.
     * This implementation always throws an
     * <tt>UnsupportedOperationException</tt>.
     * @param index the index of the element to remove.
     * @return the element previously at the specified position.
     * @throws UnsupportedOperationException if the <tt>remove</tt> method is
     *    not supported by this list.
     * @throws IndexOutOfBoundsException if the specified index is out of
     *     range (<tt>index < 0 || index >= size()</tt>).
     */
public E remove(int index) {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.AbstractList.set(int, E)

/**
     * Replaces the element at the specified position in this list with the
     * specified element (optional operation). 
     * This implementation always throws an
     * <tt>UnsupportedOperationException</tt>.
     * @param index index of element to replace.
     * @param element element to be stored at the specified position.
     * @return the element previously at the specified position.
     * @throws UnsupportedOperationException if the <tt>set</tt> method is not
     *    supported by this List.
     * @throws ClassCastException if the class of the specified element
     *     prevents it from being added to this list.
     * @throws IllegalArgumentException if some aspect of the specified
     *    element prevents it from being added to this list.
     * @throws IndexOutOfBoundsException if the specified index is out of
     *            range (<tt>index < 0 || index >= size()</tt>).
     */
public E set(int index, E element) {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.AbstractMap.put(K, V)

/**
     * Associates the specified value with the specified key in this map
     * (optional operation).  If the map previously contained a mapping for
     * this key, the old value is replaced.
     * This implementation always throws an
     * <tt>UnsupportedOperationException</tt>.
     * @param key key with which the specified value is to be associated.
     * @param value value to be associated with the specified key.
     * @return previous value associated with specified key, or <tt>null</tt>
     *        if there was no mapping for key.  (A <tt>null</tt> return can
     *        also indicate that the map previously associated <tt>null</tt>
     *        with the specified key, if the implementation supports
     *        <tt>null</tt> values.)
     * @throws UnsupportedOperationException if the <tt>put</tt> operation is
     *           not supported by this map.
     * @throws ClassCastException if the class of the specified key or value
     *            prevents it from being stored in this map.
     * @throws IllegalArgumentException if some aspect of this key or value *
     *            prevents it from being stored in this map.
     * @throws NullPointerException if this map does not permit <tt>null</tt>
     *            keys or values, and the specified key or value is
     *            <tt>null</tt>.
     */
public V put(K key, V value) {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.Scanner.remove()

/**
     * The remove operation is not supported by this implementation of
     * <code>Iterator</code>.
     * @throws UnsupportedOperationException if this method is invoked.
     * @see java.util.Iterator
     */
public void remove() {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.locks.AbstractQueuedSynchronizer.isHeldExclusively()

/**
     * Returns true if synchronization is held exclusively with respect
     * to the current (calling) thread.  This method is invoked
     * upon each call to a non-waiting {@link ConditionObject} method.
     * (Waiting methods instead invoke {@link #release}.)
     * The default implementation throws {@link
     * UnsupportedOperationException}. This method is invoked
     * internally only within {@link ConditionObject} methods, so need
     * not be defined if conditions are not used.
     * @return true if synchronization is held exclusively;
     * else false
     * @throws UnsupportedOperationException if conditions are not supported
     */
protected boolean isHeldExclusively() {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquire(int)

/**
     * Attempts to acquire in exclusive mode. This method should query
     * if the state of the object permits it to be acquired in the
     * exclusive mode, and if so to acquire it.
     * This method is always invoked by the thread performing
     * acquire.  If this method reports failure, the acquire method
     * may queue the thread, if it is not already queued, until it is
     * signalled by a release from some other thread. This can be used
     * to implement method {@link Lock#tryLock()}. 
     * The default
     * implementation throws {@link UnsupportedOperationException}
     * @param arg the acquire argument. This value
     * is always the one passed to an acquire method,
     * or is the value saved on entry to a condition wait.
     * The value is otherwise uninterpreted and can represent anything
     * you like.
     * @return true if successful. Upon success, this object has been
     * acquired.
     * @throws IllegalMonitorStateException if acquiring would place
     * this synchronizer in an illegal state. This exception must be
     * thrown in a consistent fashion for synchronization to work
     * correctly.
     * @throws UnsupportedOperationException if exclusive mode is not supported
     */
protected boolean tryAcquire(int arg) {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireShared(int)

/**
     * Attempts to acquire in shared mode. This method should query if
     * the state of the object permits it to be acquired in the shared
     * mode, and if so to acquire it.  
     * This method is always invoked by the thread performing
     * acquire.  If this method reports failure, the acquire method
     * may queue the thread, if it is not already queued, until it is
     * signalled by a release from some other thread.
     * The default implementation throws {@link
     * UnsupportedOperationException}
     * @param arg the acquire argument. This value
     * is always the one passed to an acquire method,
     * or is the value saved on entry to a condition wait.
     * The value is otherwise uninterpreted and can represent anything
     * you like.
     * @return a negative value on failure, zero on exclusive success,
     * and a positive value if non-exclusively successful, in which
     * case a subsequent waiting thread must check
     * availability. (Support for three different return values
     * enables this method to be used in contexts where acquires only
     * sometimes act exclusively.)  Upon success, this object has been
     * acquired.
     * @throws IllegalMonitorStateException if acquiring would place
     * this synchronizer in an illegal state. This exception must be
     * thrown in a consistent fashion for synchronization to work
     * correctly.
     * @throws UnsupportedOperationException if shared mode is not supported
     */
protected int tryAcquireShared(int arg) {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.locks.AbstractQueuedSynchronizer.tryRelease(int)

/**
     * Attempts to set the state to reflect a release in exclusive
     * mode.  This method is always invoked by the thread
     * performing release.
     * The default implementation throws
     * {@link UnsupportedOperationException}
     * @param arg the release argument. This value
     * is always the one passed to a release method,
     * or the current state value upon entry to a condition wait.
     * The value is otherwise uninterpreted and can represent anything
     * you like.
     * @return <tt>true</tt> if this object is now in a fully released state, 
     * so that any waiting threads may attempt to acquire; and <tt>false</tt>
     * otherwise.
     * @throws IllegalMonitorStateException if releasing would place
     * this synchronizer in an illegal state. This exception must be
     * thrown in a consistent fashion for synchronization to work
     * correctly.
     * @throws UnsupportedOperationException if exclusive mode is not supported
     */
protected boolean tryRelease(int arg) {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.locks.AbstractQueuedSynchronizer.tryReleaseShared(int)

/**
     * Attempts to set the state to reflect a release in shared mode.
     * This method is always invoked by the thread performing release.
     *  The default implementation throws 
     * {@link UnsupportedOperationException}
     * @param arg the release argument. This value
     * is always the one passed to a release method,
     * or the current state value upon entry to a condition wait.
     * The value is otherwise uninterpreted and can represent anything
     * you like.
     * @return <tt>true</tt> if this object is now in a fully released state, 
     * so that any waiting threads may attempt to acquire; and <tt>false</tt>
     * otherwise.
     * @throws IllegalMonitorStateException if releasing would place
     * this synchronizer in an illegal state. This exception must be
     * thrown in a consistent fashion for synchronization to work
     * correctly.
     * @throws UnsupportedOperationException if shared mode is not supported
     */
protected boolean tryReleaseShared(int arg) {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.spi.PartiallyOrderedSet.remove()

public void remove() {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.spi.ServiceRegistry.remove()

public void remove() {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.naming.NameClassPair.getNameInNamespace()

/**
     * Retrieves the full name of this binding.
     * The full name is the absolute name of this binding within
     * its own namespace. See {@link Context#getNameInNamespace()}.
     *
     * In naming systems for which the notion of full name does not
     * apply to this binding an <tt>UnsupportedOperationException</tt>
     * is thrown.
     * This exception is also thrown when a service provider written before
     * the introduction of the method is in use.
     * The string returned by this method is not a JNDI composite name and
     * should not be passed directly to context methods.
     * @return The full name of this binding.
     * @throws UnsupportedOperationException if the notion of full name
     *         does not apply to this binding in the naming system.
     * @since 1.5
     * @see #setNameInNamespace
     * @see #getName
     */
public String getNameInNamespace() {
    if (fullName == null) {
        throw new UnsupportedOperationException();
    }
    return fullName;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.security.auth.callback.ChoiceCallback.setSelectedIndexes(int[])

/**
     * Set the selected choices.
     * 
     * @param selections the selections represented as indexes into the
     *  <code>choices</code> list.
     * @exception UnsupportedOperationException if multiple selections are
     *  not allowed, as determined by
     *  <code>allowMultipleSelections</code>.
     * @see #getSelectedIndexes
     */
public void setSelectedIndexes(int[] selections) {
    if (!multipleSelectionsAllowed) throw new UnsupportedOperationException();
    this.selections = selections;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.sql.rowset.serial.SerialArray.getResultSet()

/**    
     * Retrieves a <code>ResultSet</code> object that contains all of
     * the elements in the <code>ARRAY</code> value that this 
     * <code>SerialArray</code> object represents. 
     * If appropriate, the elements of the array are mapped using the connection's 
     * type map; otherwise, the standard mapping is used.          
     * @return a <code>ResultSet</code> object containing all of the 
     *         elements in this <code>SerialArray</code> object, with a 
     *         separate row for each element
     * @throws SerialException if called, which in turn throws an 
     *         <code>UnsupportedOperationException</code>, if this method is called 
     */
public ResultSet getResultSet() throws SerialException {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.sql.rowset.serial.SerialArray.getResultSet(long, int)

/**
     * Retrieves a <code>ResultSet</code> object holding the elements of 
     * the subarray that starts at
     * index <i>index</i> and contains up to <i>count</i> successive elements. 
     * This method uses the connection's type map to map the elements of 
     * the array if the map contains
     * an entry for the base type. Otherwise, the standard mapping is used.  
     * @param index the index into this <code>SerialArray</code> object 
     *         of the first element to be copied; the index of the  
     *         first element in the array is <code>0</code>   
     * @param count the number of consecutive elements to be copied, starting 
     *         at the given index 
     * @return a <code>ResultSet</code> object containing the designated 
     *         elements in this <code>SerialArray</code> object, with a 
     *         separate row for each element 
     * @throws SerialException, which in turn throws an 
     *         <code>UnsupportedOperationException</code>, if this method is called     
     */
public ResultSet getResultSet(long index, int count) throws SerialException {
    throw new UnsupportedOperationException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.validation.SchemaFactoryFinder.createServiceFileIterator()

/**
     * Returns an {@link Iterator} that enumerates all 
     * the META-INF/services files that we care.
     */
private Iterator createServiceFileIterator() {
    if (classLoader == null) {
        return new SingleIterator() {

            protected Object value() {
                ClassLoader classLoader = SchemaFactoryFinder.class.getClassLoader();
                return ss.getResourceAsURL(classLoader, SERVICE_ID);
            }
        };
    } else {
        try {
            final Enumeration e = ss.getResources(classLoader, SERVICE_ID);
            if (!e.hasMoreElements()) {
                debugPrintln('no ' + SERVICE_ID + ' file was found');
            }
            return new Iterator() {

                public void remove() {
                    throw new UnsupportedOperationException();
                }

                public boolean hasNext() {
                    return e.hasMoreElements();
                }

                public Object next() {
                    return e.nextElement();
                }
            };
        } catch (IOException e) {
            debugPrintln('failed to enumerate resources ' + SERVICE_ID);
            if (debug) e.printStackTrace();
            return new ArrayList().iterator();
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.xpath.XPathFactoryFinder.createServiceFileIterator()

/**
     * Returns an {@link Iterator} that enumerates all 
     * the META-INF/services files that we care.
     */
private Iterator createServiceFileIterator() {
    if (classLoader == null) {
        return new SingleIterator() {

            protected Object value() {
                ClassLoader classLoader = XPathFactoryFinder.class.getClassLoader();
                return ss.getResourceAsURL(classLoader, SERVICE_ID);
            }
        };
    } else {
        try {
            final Enumeration e = ss.getResources(classLoader, SERVICE_ID);
            if (!e.hasMoreElements()) {
                debugPrintln('no ' + SERVICE_ID + ' file was found');
            }
            return new Iterator() {

                public void remove() {
                    throw new UnsupportedOperationException();
                }

                public boolean hasNext() {
                    return e.hasMoreElements();
                }

                public Object next() {
                    return e.nextElement();
                }
            };
        } catch (IOException e) {
            debugPrintln('failed to enumerate resources ' + SERVICE_ID);
            if (debug) e.printStackTrace();
            return new ArrayList().iterator();
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xerces.internal.jaxp.datatype.DurationImpl.compare(Duration)

/**
  * Partial order relation comparison with this <code>Duration</code> instance.
  * 
  * Comparison result must be in accordance with
  * <a href='http://www.w3.org/TR/xmlschema-2/#duration-order'>W3C XML Schema 1.0 Part 2, Section 3.2.7.6.2,
  * <i>Order relation on duration</i></a>.
  * 
  * Return:
  * <ul>
  *   <li>{@link DatatypeConstants#LESSER} if this <code>Duration</code> is shorter than <code>duration</code> parameter</li>
  *   <li>{@link DatatypeConstants#EQUAL} if this <code>Duration</code> is equal to <code>duration</code> parameter</li>
  *   <li>{@link DatatypeConstants#GREATER} if this <code>Duration</code> is longer than <code>duration</code> parameter</li>
  *   <li>{@link DatatypeConstants#INDETERMINATE} if a conclusive partial order relation cannot be determined</li>
  * </ul>
  *
  * @param duration to compare
  * 
  * @return the relationship between <code>this</code> <code>Duration</code>and <code>duration</code> parameter as
  *   {@link DatatypeConstants#LESSER}, {@link DatatypeConstants#EQUAL}, {@link DatatypeConstants#GREATER}
  *   or {@link DatatypeConstants#INDETERMINATE}.
  * 
  * @throws UnsupportedOperationException If the underlying implementation
  *   cannot reasonably process the request, e.g. W3C XML Schema allows for
  *   arbitrarily large/small/precise values, the request may be beyond the
  *   implementations capability.
  * @throws NullPointerException if <code>duration</code> is <code>null</code>. 
  *
  * @see #isShorterThan(Duration)
  * @see #isLongerThan(Duration)
  */
public int compare(Duration rhs) {
    BigInteger maxintAsBigInteger = BigInteger.valueOf((long) Integer.MAX_VALUE);
    BigInteger minintAsBigInteger = BigInteger.valueOf((long) Integer.MIN_VALUE);
    if (years != null && years.compareTo(maxintAsBigInteger) == 1) {
        throw new UnsupportedOperationException(DatatypeMessageFormatter.formatMessage(null, 'TooLarge', new Object[] { this.getClass().getName() + '#compare(Duration duration)' + DatatypeConstants.YEARS.toString(), years.toString() }));
    }
    if (months != null && months.compareTo(maxintAsBigInteger) == 1) {
        throw new UnsupportedOperationException(DatatypeMessageFormatter.formatMessage(null, 'TooLarge', new Object[] { this.getClass().getName() + '#compare(Duration duration)' + DatatypeConstants.MONTHS.toString(), months.toString() }));
    }
    if (days != null && days.compareTo(maxintAsBigInteger) == 1) {
        throw new UnsupportedOperationException(DatatypeMessageFormatter.formatMessage(null, 'TooLarge', new Object[] { this.getClass().getName() + '#compare(Duration duration)' + DatatypeConstants.DAYS.toString(), days.toString() }));
    }
    if (hours != null && hours.compareTo(maxintAsBigInteger) == 1) {
        throw new UnsupportedOperationException(DatatypeMessageFormatter.formatMessage(null, 'TooLarge', new Object[] { this.getClass().getName() + '#compare(Duration duration)' + DatatypeConstants.HOURS.toString(), hours.toString() }));
    }
    if (minutes != null && minutes.compareTo(maxintAsBigInteger) == 1) {
        throw new UnsupportedOperationException(DatatypeMessageFormatter.formatMessage(null, 'TooLarge', new Object[] { this.getClass().getName() + '#compare(Duration duration)' + DatatypeConstants.MINUTES.toString(), minutes.toString() }));
    }
    if (seconds != null && seconds.toBigInteger().compareTo(maxintAsBigInteger) == 1) {
        throw new UnsupportedOperationException(DatatypeMessageFormatter.formatMessage(null, 'TooLarge', new Object[] { this.getClass().getName() + '#compare(Duration duration)' + DatatypeConstants.SECONDS.toString(), seconds.toString() }));
    }
    BigInteger rhsYears = (BigInteger) rhs.getField(DatatypeConstants.YEARS);
    if (rhsYears != null && rhsYears.compareTo(maxintAsBigInteger) == 1) {
        throw new UnsupportedOperationException(DatatypeMessageFormatter.formatMessage(null, 'TooLarge', new Object[] { this.getClass().getName() + '#compare(Duration duration)' + DatatypeConstants.YEARS.toString(), rhsYears.toString() }));
    }
    BigInteger rhsMonths = (BigInteger) rhs.getField(DatatypeConstants.MONTHS);
    if (rhsMonths != null && rhsMonths.compareTo(maxintAsBigInteger) == 1) {
        throw new UnsupportedOperationException(DatatypeMessageFormatter.formatMessage(null, 'TooLarge', new Object[] { this.getClass().getName() + '#compare(Duration duration)' + DatatypeConstants.MONTHS.toString(), rhsMonths.toString() }));
    }
    BigInteger rhsDays = (BigInteger) rhs.getField(DatatypeConstants.DAYS);
    if (rhsDays != null && rhsDays.compareTo(maxintAsBigInteger) == 1) {
        throw new UnsupportedOperationException(DatatypeMessageFormatter.formatMessage(null, 'TooLarge', new Object[] { this.getClass().getName() + '#compare(Duration duration)' + DatatypeConstants.DAYS.toString(), rhsDays.toString() }));
    }
    BigInteger rhsHours = (BigInteger) rhs.getField(DatatypeConstants.HOURS);
    if (rhsHours != null && rhsHours.compareTo(maxintAsBigInteger) == 1) {
        throw new UnsupportedOperationException(DatatypeMessageFormatter.formatMessage(null, 'TooLarge', new Object[] { this.getClass().getName() + '#compare(Duration duration)' + DatatypeConstants.HOURS.toString(), rhsHours.toString() }));
    }
    BigInteger rhsMinutes = (BigInteger) rhs.getField(DatatypeConstants.MINUTES);
    if (rhsMinutes != null && rhsMinutes.compareTo(maxintAsBigInteger) == 1) {
        throw new UnsupportedOperationException(DatatypeMessageFormatter.formatMessage(null, 'TooLarge', new Object[] { this.getClass().getName() + '#compare(Duration duration)' + DatatypeConstants.MINUTES.toString(), rhsMinutes.toString() }));
    }
    BigDecimal rhsSecondsAsBigDecimal = (BigDecimal) rhs.getField(DatatypeConstants.SECONDS);
    BigInteger rhsSeconds = null;
    if (rhsSecondsAsBigDecimal != null) {
        rhsSeconds = rhsSecondsAsBigDecimal.toBigInteger();
    }
    if (rhsSeconds != null && rhsSeconds.compareTo(maxintAsBigInteger) == 1) {
        throw new UnsupportedOperationException(DatatypeMessageFormatter.formatMessage(null, 'TooLarge', new Object[] { this.getClass().getName() + '#compare(Duration duration)' + DatatypeConstants.SECONDS.toString(), rhsSeconds.toString() }));
    }
    GregorianCalendar lhsCalendar = new GregorianCalendar(1970, 1, 1, 0, 0, 0);
    lhsCalendar.add(GregorianCalendar.YEAR, getYears() * getSign());
    lhsCalendar.add(GregorianCalendar.MONTH, getMonths() * getSign());
    lhsCalendar.add(GregorianCalendar.DAY_OF_YEAR, getDays() * getSign());
    lhsCalendar.add(GregorianCalendar.HOUR_OF_DAY, getHours() * getSign());
    lhsCalendar.add(GregorianCalendar.MINUTE, getMinutes() * getSign());
    lhsCalendar.add(GregorianCalendar.SECOND, getSeconds() * getSign());
    GregorianCalendar rhsCalendar = new GregorianCalendar(1970, 1, 1, 0, 0, 0);
    rhsCalendar.add(GregorianCalendar.YEAR, rhs.getYears() * rhs.getSign());
    rhsCalendar.add(GregorianCalendar.MONTH, rhs.getMonths() * rhs.getSign());
    rhsCalendar.add(GregorianCalendar.DAY_OF_YEAR, rhs.getDays() * rhs.getSign());
    rhsCalendar.add(GregorianCalendar.HOUR_OF_DAY, rhs.getHours() * rhs.getSign());
    rhsCalendar.add(GregorianCalendar.MINUTE, rhs.getMinutes() * rhs.getSign());
    rhsCalendar.add(GregorianCalendar.SECOND, rhs.getSeconds() * rhs.getSign());
    if (lhsCalendar.before(rhsCalendar)) {
        return DatatypeConstants.LESSER;
    }
    if (lhsCalendar.after(rhsCalendar)) {
        return DatatypeConstants.GREATER;
    }
    if (lhsCalendar.equals(rhsCalendar)) {
        return DatatypeConstants.EQUAL;
    }
    return DatatypeConstants.INDETERMINATE;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.setTiling(int, int, int, int)

/**
     * Specifies that the image should be tiled in the output stream.
     * The <code>tileWidth</code> and <code>tileHeight</code>
     * parameters specify the width and height of the tiles in the
     * file.  If the tile width or height is greater than the width or
     * height of the image, the image is not tiled in that dimension.
     *  If <code>canOffsetTiles</code> returns <code>false</code>,
     * then the <code>tileGridXOffset</code> and
     * <code>tileGridYOffset</code> parameters must be zero.
     * @param tileWidth the width of each tile.
     * @param tileHeight the height of each tile.
     * @param tileGridXOffset the horizontal offset of the tile grid.
     * @param tileGridYOffset the vertical offset of the tile grid.
     * @exception UnsupportedOperationException if the plug-in does not
     * support tiling.
     * @exception IllegalStateException if the tiling mode is not
     * <code>MODE_EXPLICIT</code>.
     * @exception UnsupportedOperationException if the plug-in does not
     * support grid offsets, and the grid offsets are not both zero.
     * @exception IllegalArgumentException if the tile size is not
     * within one of the allowable ranges returned by
     * <code>getPreferredTileSizes</code>.
     * @exception IllegalArgumentException if <code>tileWidth</code>
     * or <code>tileHeight</code> is less than or equal to 0.
     * @see #canWriteTiles
     * @see #canOffsetTiles
     * @see #getTileWidth()
     * @see #getTileHeight()
     * @see #getTileGridXOffset()
     * @see #getTileGridYOffset()
     */
public void setTiling(int tileWidth, int tileHeight, int tileGridXOffset, int tileGridYOffset) {
    if (!canWriteTiles()) {
        throw new UnsupportedOperationException('Tiling not supported!');
    }
    if (getTilingMode() != MODE_EXPLICIT) {
        throw new IllegalStateException('Tiling mode not MODE_EXPLICIT!');
    }
    if (tileWidth <= 0 || tileHeight <= 0) {
        throw new IllegalArgumentException('tile dimensions are non-positive!');
    }
    boolean tilesOffset = (tileGridXOffset != 0) || (tileGridYOffset != 0);
    if (!canOffsetTiles() && tilesOffset) {
        throw new UnsupportedOperationException('Can't offset tiles!');
    }
    if (preferredTileSizes != null) {
        boolean ok = true;
        for (int i = 0; i < preferredTileSizes.length; i += 2) {
            Dimension min = preferredTileSizes[i];
            Dimension max = preferredTileSizes[i + 1];
            if ((tileWidth < min.width) || (tileWidth > max.width) || (tileHeight < min.height) || (tileHeight > max.height)) {
                ok = false;
                break;
            }
        }
        if (!ok) {
            throw new IllegalArgumentException('Illegal tile size!');
        }
    }
    this.tilingSet = true;
    this.tileWidth = tileWidth;
    this.tileHeight = tileHeight;
    this.tileGridXOffset = tileGridXOffset;
    this.tileGridYOffset = tileGridYOffset;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.prefs.AbstractPreferences.removeNode()

/**

     * Implements the <tt>removeNode()</tt> method as per the specification in
     * {@link Preferences#removeNode()}.
     * This implementation checks to see that this node is the root; if so,
     * it throws an appropriate exception.  Then, it locks this node's parent,
     * and calls a recursive helper method that traverses the subtree rooted at
     * this node.  The recursive method locks the node on which it was called,
     * checks that it has not already been removed, and then ensures that all
     * of its children are cached: The {@link #childrenNamesSpi()} method is
     * invoked and each returned child name is checked for containment in the
     * child-cache.  If a child is not already cached, the {@link
     * #childSpi(String)} method is invoked to create a <tt>Preferences</tt>
     * instance for it, and this instance is put into the child-cache.  Then
     * the helper method calls itself recursively on each node contained in its
     * child-cache.  Next, it invokes {@link #removeNodeSpi()}, marks itself
     * as removed, and removes itself from its parent's child-cache.  Finally,
     * if there are any node change listeners, it enqueues a notification
     * event for processing by the event dispatch thread.
     * Note that the helper method is always invoked with all ancestors up
     * to the 'closest non-removed ancestor' locked.
     * @throws IllegalStateException if this node (or an ancestor) has already
     *         been removed with the {@link #removeNode()} method.
     * @throws UnsupportedOperationException if this method is invoked on 
     *         the root node.
     * @throws BackingStoreException if this operation cannot be completed
     *         due to a failure in the backing store, or inability to 
     *         communicate with it.
     */
public void removeNode() throws BackingStoreException {
    if (this == root) throw new UnsupportedOperationException('Can't remove the root!');
    synchronized (parent.lock) {
        removeNode2();
        parent.kidCache.remove(name);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageReadParam.setSourceRenderSize(Dimension)

/**
     * If the image is able to be rendered at an arbitrary size, sets
     * the source width and height to the supplied values.  Note that
     * the values returned from the <code>getWidth</code> and
     * <code>getHeight</code> methods on <code>ImageReader</code> are
     * not affected by this method; they will continue to return the
     * default size for the image.  Similarly, if the image is also
     * tiled the tile width and height are given in terms of the default
     * size.
     *  Typically, the width and height should be chosen such that
     * the ratio of width to height closely approximates the aspect
     * ratio of the image, as returned from
     * <code>ImageReader.getAspectRatio</code>.
     *  If this plug-in does not allow the rendering size to be
     * set, an <code>UnsupportedOperationException</code> will be
     * thrown.
     *  To remove the render size setting, pass in a value of
     * <code>null</code> for <code>size</code>.
     * @param size a <code>Dimension</code> indicating the desired
     * width and height.
     * @exception IllegalArgumentException if either the width or the
     * height is negative or 0.
     * @exception UnsupportedOperationException if image resizing
     * is not supported by this plug-in.
     * @see #getSourceRenderSize
     * @see ImageReader#getWidth
     * @see ImageReader#getHeight
     * @see ImageReader#getAspectRatio
     */
public void setSourceRenderSize(Dimension size) throws UnsupportedOperationException {
    if (!canSetSourceRenderSize()) {
        throw new UnsupportedOperationException('Can't set source render size!');
    }
    if (size == null) {
        this.sourceRenderSize = null;
    } else {
        if (size.width <= 0 || size.height <= 0) {
            throw new IllegalArgumentException('width or height <= 0!');
        }
        this.sourceRenderSize = (Dimension) size.clone();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.GraphicsDevice.setDisplayMode(DisplayMode)

/**
     * Sets the display mode of this graphics device.  This may only be allowed
     * in full-screen, exclusive mode.
     * @param dm the new display mode of this graphics device
     * @exception IllegalArgumentException if the <code>DisplayMode</code>
     * supplied is <code>null</code>, or is not available in the array returned
     * by <code>getDisplayModes</code>
     * @exception UnsupportedOperationException if
     * <code>isDisplayChangeSupported</code> returns <code>false</code>
     * @see #getDisplayMode
     * @see #getDisplayModes
     * @see #isDisplayChangeSupported
     * @since 1.4
     */
public void setDisplayMode(DisplayMode dm) {
    throw new UnsupportedOperationException('Cannot change display mode');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.getCompressionTypes()

/**
     * Returns a list of available compression types, as an array or
     * <code>String</code>s, or <code>null</code> if a compression
     * type may not be chosen using these interfaces.  The array
     * returned is a copy.
     *  If the writer only offers a single, mandatory form of
     * compression, it is not necessary to provide any named
     * compression types.  Named compression types should only be
     * used where the user is able to make a meaningful choice
     * between different schemes.
     *  The default implementation checks if compression is
     * supported and throws an
     * <code>UnsupportedOperationException</code> if not.  Otherwise,
     * it returns a clone of the <code>compressionTypes</code>
     * instance variable if it is non-<code>null</code>, or else
     * returns <code>null</code>.
     * @return an array of <code>String</code>s containing the
     * (non-localized) names of available compression types, or
     * <code>null</code>.
     * @exception UnsupportedOperationException if the writer does not
     * support compression.
     */
public String[] getCompressionTypes() {
    if (!canWriteCompressed()) {
        throw new UnsupportedOperationException('Compression not supported');
    }
    if (compressionTypes == null) {
        return null;
    }
    return (String[]) compressionTypes.clone();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.isCompressionLossless()

/**
     * Returns <code>true</code> if the current compression type
     * provides lossless compression.  If a plug-in provides only
     * one mandatory compression type, then this method may be
     * called without calling <code>setCompressionType</code> first.
     *  If there are multiple compression types but none has
     * been set, an <code>IllegalStateException</code> is thrown.
     *  The default implementation checks whether compression is
     * supported and the compression mode is
     * <code>MODE_EXPLICIT</code>.  If so, if
     * <code>getCompressionTypes()</code> is <code>null</code> or
     * <code>getCompressionType()</code> is non-<code>null</code>
     * <code>true</code> is returned as a convenience.
     * @return <code>true</code> if the current compression type is
     * lossless.
     * @exception UnsupportedOperationException if the writer does not
     * support compression.
     * @exception IllegalStateException if the compression mode is not
     * <code>MODE_EXPLICIT</code>.
     * @exception IllegalStateException if the set of legal
     * compression types is non-<code>null</code> and the current
     * compression type is <code>null</code>.
     */
public boolean isCompressionLossless() {
    if (!canWriteCompressed()) {
        throw new UnsupportedOperationException('Compression not supported');
    }
    if (getCompressionMode() != MODE_EXPLICIT) {
        throw new IllegalStateException('Compression mode not MODE_EXPLICIT!');
    }
    if ((getCompressionTypes() != null) && (getCompressionType() == null)) {
        throw new IllegalStateException('No compression type set!');
    }
    return true;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.setCompressionQuality(float)

/**
     * Sets the compression quality to a value between <code>0</code>
     * and <code>1</code>.  Only a single compression quality setting
     * is supported by default; writers can provide extended versions
     * of <code>ImageWriteParam</code> that offer more control.  For
     * lossy compression schemes, the compression quality should
     * control the tradeoff between file size and image quality (for
     * example, by choosing quantization tables when writing JPEG
     * images).  For lossless schemes, the compression quality may be
     * used to control the tradeoff between file size and time taken
     * to perform the compression (for example, by optimizing row
     * filters and setting the ZLIB compression level when writing
     * PNG images).
     *  A compression quality setting of 0.0 is most generically
     * interpreted as 'high compression is important,' while a setting of
     * 1.0 is most generically interpreted as 'high image quality is
     * important.'
     *  If there are multiple compression types but none has been
     * set, an <code>IllegalStateException</code> is thrown.
     *  The default implementation checks that compression is
     * supported, and that the compression mode is
     * <code>MODE_EXPLICIT</code>.  If so, if
     * <code>getCompressionTypes()</code> returns <code>null</code> or
     * <code>compressionType</code> is non-<code>null</code> it sets
     * the <code>compressionQuality</code> instance variable.
     * @param quality a <code>float</code> between <code>0</code>and
     * <code>1</code> indicating the desired quality level.
     * @exception UnsupportedOperationException if the writer does not
     * support compression.
     * @exception IllegalStateException if the compression mode is not
     * <code>MODE_EXPLICIT</code>.
     * @exception IllegalStateException if the set of legal
     * compression types is non-<code>null</code> and the current
     * compression type is <code>null</code>.
     * @exception IllegalArgumentException if <code>quality</code> is
     * not between <code>0</code>and <code>1</code>, inclusive.
     * @see #getCompressionQuality
     */
public void setCompressionQuality(float quality) {
    if (!canWriteCompressed()) {
        throw new UnsupportedOperationException('Compression not supported');
    }
    if (getCompressionMode() != MODE_EXPLICIT) {
        throw new IllegalStateException('Compression mode not MODE_EXPLICIT!');
    }
    if (getCompressionTypes() != null && getCompressionType() == null) {
        throw new IllegalStateException('No compression type set!');
    }
    if (quality < 0.0F || quality > 1.0F) {
        throw new IllegalArgumentException('Quality out-of-bounds!');
    }
    this.compressionQuality = quality;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.setCompressionType(String)

/**
     * Sets the compression type to one of the values indicated by
     * <code>getCompressionTypes</code>.  If a value of
     * <code>null</code> is passed in, any previous setting is
     * removed.
     *  The default implementation checks whether compression is
     * supported and the compression mode is
     * <code>MODE_EXPLICIT</code>.  If so, it calls
     * <code>getCompressionTypes</code> and checks if
     * <code>compressionType</code> is one of the legal values.  If it
     * is, the <code>compressionType</code> instance variable is set.
     * If <code>compressionType</code> is <code>null</code>, the
     * instance variable is set without performing any checking.
     * @param compressionType one of the <code>String</code>s returned
     * by <code>getCompressionTypes</code>, or <code>null</code> to
     * remove any previous setting.
     * @exception UnsupportedOperationException if the writer does not
     * support compression.
     * @exception IllegalStateException if the compression mode is not
     * <code>MODE_EXPLICIT</code>.
     * @exception UnsupportedOperationException if there are no
     * settable compression types.
     * @exception IllegalArgumentException if
     * <code>compressionType</code> is non-<code>null</code> but is not
     * one of the values returned by <code>getCompressionTypes</code>.
     * @see #getCompressionTypes
     * @see #getCompressionType
     * @see #unsetCompression
     */
public void setCompressionType(String compressionType) {
    if (!canWriteCompressed()) {
        throw new UnsupportedOperationException('Compression not supported');
    }
    if (getCompressionMode() != MODE_EXPLICIT) {
        throw new IllegalStateException('Compression mode not MODE_EXPLICIT!');
    }
    String[] legalTypes = getCompressionTypes();
    if (legalTypes == null) {
        throw new UnsupportedOperationException('No settable compression types');
    }
    if (compressionType != null) {
        boolean found = false;
        if (legalTypes != null) {
            for (int i = 0; i < legalTypes.length; i++) {
                if (compressionType.equals(legalTypes[i])) {
                    found = true;
                    break;
                }
            }
        }
        if (!found) {
            throw new IllegalArgumentException('Unknown compression type!');
        }
    }
    this.compressionType = compressionType;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.unsetCompression()

/**
     * Removes any previous compression type and quality settings.
     *  The default implementation sets the instance variable
     * <code>compressionType</code> to <code>null</code>, and the
     * instance variable <code>compressionQuality</code> to
     * <code>1.0F</code>.
     * @exception UnsupportedOperationException if the plug-in does not
     * support compression.
     * @exception IllegalStateException if the compression mode is not
     * <code>MODE_EXPLICIT</code>.
     * @see #setCompressionType
     * @see #setCompressionQuality
     */
public void unsetCompression() {
    if (!canWriteCompressed()) {
        throw new UnsupportedOperationException('Compression not supported');
    }
    if (getCompressionMode() != MODE_EXPLICIT) {
        throw new IllegalStateException('Compression mode not MODE_EXPLICIT!');
    }
    this.compressionType = null;
    this.compressionQuality = 1.0F;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.getBitRate(float)

/**
     * Returns a <code>float</code> indicating an estimate of the
     * number of bits of output data for each bit of input image data
     * at the given quality level.  The value will typically lie
     * between <code>0</code> and <code>1</code>, with smaller values
     * indicating more compression.  A special value of
     * <code>-1.0F</code> is used to indicate that no estimate is
     * available.
     *  If there are multiple compression types but none has been set,
     * an <code>IllegalStateException</code> is thrown.
     *  The default implementation checks that compression is
     * supported and the compression mode is
     * <code>MODE_EXPLICIT</code>.  If so, if
     * <code>getCompressionTypes()</code> is <code>null</code> or
     * <code>getCompressionType()</code> is non-<code>null</code>, and
     * <code>quality</code> is within bounds, it returns
     * <code>-1.0</code>.
     * @param quality the quality setting whose bit rate is to be
     * queried.
     * @return an estimate of the compressed bit rate, or
     * <code>-1.0F</code> if no estimate is available.
     * @exception UnsupportedOperationException if the writer does not
     * support compression.
     * @exception IllegalStateException if the compression mode is not
     * <code>MODE_EXPLICIT</code>.
     * @exception IllegalStateException if the set of legal
     * compression types is non-<code>null</code> and the current
     * compression type is <code>null</code>.
     * @exception IllegalArgumentException if <code>quality</code> is
     * not between <code>0</code>and <code>1</code>, inclusive.
     */
public float getBitRate(float quality) {
    if (!canWriteCompressed()) {
        throw new UnsupportedOperationException('Compression not supported.');
    }
    if (getCompressionMode() != MODE_EXPLICIT) {
        throw new IllegalStateException('Compression mode not MODE_EXPLICIT!');
    }
    if ((getCompressionTypes() != null) && (getCompressionType() == null)) {
        throw new IllegalStateException('No compression type set!');
    }
    if (quality < 0.0F || quality > 1.0F) {
        throw new IllegalArgumentException('Quality out-of-bounds!');
    }
    return -1.0F;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.getCompressionMode()

/**
     * Returns the current compression mode, if compression is
     * supported.
     * @return the current compression mode.
     * @exception UnsupportedOperationException if the writer does not
     * support compression.
     * @see #setCompressionMode
     */
public int getCompressionMode() {
    if (!canWriteCompressed()) {
        throw new UnsupportedOperationException('Compression not supported.');
    }
    return compressionMode;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.getCompressionQuality()

/**
     * Returns the current compression quality setting.
     *  If there are multiple compression types but none has been
     * set, an <code>IllegalStateException</code> is thrown.
     *  The default implementation checks that compression is
     * supported and that the compression mode is
     * <code>MODE_EXPLICIT</code>.  If so, if
     * <code>getCompressionTypes()</code> is <code>null</code> or
     * <code>getCompressionType()</code> is non-<code>null</code>, it
     * returns the value of the <code>compressionQuality</code>
     * instance variable.
     * @return the current compression quality setting.
     * @exception UnsupportedOperationException if the writer does not
     * support compression.
     * @exception IllegalStateException if the compression mode is not
     * <code>MODE_EXPLICIT</code>.
     * @exception IllegalStateException if the set of legal
     * compression types is non-<code>null</code> and the current
     * compression type is <code>null</code>.
     * @see #setCompressionQuality
     */
public float getCompressionQuality() {
    if (!canWriteCompressed()) {
        throw new UnsupportedOperationException('Compression not supported.');
    }
    if (getCompressionMode() != MODE_EXPLICIT) {
        throw new IllegalStateException('Compression mode not MODE_EXPLICIT!');
    }
    if ((getCompressionTypes() != null) && (getCompressionType() == null)) {
        throw new IllegalStateException('No compression type set!');
    }
    return compressionQuality;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.getCompressionQualityDescriptions()

/**
     * Returns an array of <code>String</code>s that may be used along
     * with <code>getCompressionQualityValues</code> as part of a user
     * interface for setting or displaying the compression quality
     * level.  The <code>String</code> with index <code>i</code>
     * provides a description of the range of quality levels between
     * <code>getCompressionQualityValues[i]</code> and
     * <code>getCompressionQualityValues[i + 1]</code>.  Note that the
     * length of the array returned from
     * <code>getCompressionQualityValues</code> will always be one
     * greater than that returned from
     * <code>getCompressionQualityDescriptions</code>.
     *  As an example, the strings 'Good', 'Better', and 'Best'
     * could be associated with the ranges <code>[0, .33)</code>,
     * <code>[.33, .66)</code>, and <code>[.66, 1.0]</code>.  In this
     * case, <code>getCompressionQualityDescriptions</code> would
     * return <code>{ 'Good', 'Better', 'Best' }</code> and
     * <code>getCompressionQualityValues</code> would return
     * <code>{ 0.0F, .33F, .66F, 1.0F }</code>.
     *  If no descriptions are available, <code>null</code> is
     * returned.  If <code>null</code> is returned from
     * <code>getCompressionQualityValues</code>, this method must also
     * return <code>null</code>.
     *  The descriptions should be localized for the
     * <code>Locale</code> returned by <code>getLocale</code>, if it
     * is non-<code>null</code>.
     *  If there are multiple compression types but none has been set,
     * an <code>IllegalStateException</code> is thrown.
     *  The default implementation checks that compression is
     * supported and that the compression mode is
     * <code>MODE_EXPLICIT</code>.  If so, if
     * <code>getCompressionTypes()</code> is <code>null</code> or
     * <code>getCompressionType()</code> is non-<code>null</code>, it
     * returns <code>null</code>.
     * @return an array of <code>String</code>s containing localized
     * descriptions of the compression quality levels.
     * @exception UnsupportedOperationException if the writer does not
     * support compression.
     * @exception IllegalStateException if the compression mode is not
     * <code>MODE_EXPLICIT</code>.
     * @exception IllegalStateException if the set of legal
     * compression types is non-<code>null</code> and the current
     * compression type is <code>null</code>.
     * @see #getCompressionQualityValues
     */
public String[] getCompressionQualityDescriptions() {
    if (!canWriteCompressed()) {
        throw new UnsupportedOperationException('Compression not supported.');
    }
    if (getCompressionMode() != MODE_EXPLICIT) {
        throw new IllegalStateException('Compression mode not MODE_EXPLICIT!');
    }
    if ((getCompressionTypes() != null) && (getCompressionType() == null)) {
        throw new IllegalStateException('No compression type set!');
    }
    return null;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.getCompressionQualityValues()

/**
     * Returns an array of <code>float</code>s that may be used along
     * with <code>getCompressionQualityDescriptions</code> as part of a user
     * interface for setting or displaying the compression quality
     * level.  See {@link #getCompressionQualityDescriptions
     * <code>getCompressionQualityDescriptions</code>} for more information.
     *  If no descriptions are available, <code>null</code> is
     * returned.  If <code>null</code> is returned from
     * <code>getCompressionQualityDescriptions</code>, this method
     * must also return <code>null</code>.
     *  If there are multiple compression types but none has been set,
     * an <code>IllegalStateException</code> is thrown.
     *  The default implementation checks that compression is
     * supported and that the compression mode is
     * <code>MODE_EXPLICIT</code>.  If so, if
     * <code>getCompressionTypes()</code> is <code>null</code> or
     * <code>getCompressionType()</code> is non-<code>null</code>, it
     * returns <code>null</code>.
     * @return an array of <code>float</code>s indicating the
     * boundaries between the compression quality levels as described
     * by the <code>String</code>s from
     * <code>getCompressionQualityDescriptions</code>.
     * @exception UnsupportedOperationException if the writer does not
     * support compression.
     * @exception IllegalStateException if the compression mode is not
     * <code>MODE_EXPLICIT</code>.
     * @exception IllegalStateException if the set of legal
     * compression types is non-<code>null</code> and the current
     * compression type is <code>null</code>.
     * @see #getCompressionQualityDescriptions
     */
public float[] getCompressionQualityValues() {
    if (!canWriteCompressed()) {
        throw new UnsupportedOperationException('Compression not supported.');
    }
    if (getCompressionMode() != MODE_EXPLICIT) {
        throw new IllegalStateException('Compression mode not MODE_EXPLICIT!');
    }
    if ((getCompressionTypes() != null) && (getCompressionType() == null)) {
        throw new IllegalStateException('No compression type set!');
    }
    return null;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.getCompressionType()

/**
     * Returns the currently set compression type, or
     * <code>null</code> if none has been set.  The type is returned
     * as a <code>String</code> from among those returned by
     * <code>getCompressionTypes</code>.
     * If no compression type has been set, <code>null</code> is
     * returned.
     *  The default implementation checks whether compression is
     * supported and the compression mode is
     * <code>MODE_EXPLICIT</code>.  If so, it returns the value of the
     * <code>compressionType</code> instance variable.
     * @return the current compression type as a <code>String</code>,
     * or <code>null</code> if no type is set.
     * @exception UnsupportedOperationException if the writer does not
     * support compression.
     * @exception IllegalStateException if the compression mode is not
     * <code>MODE_EXPLICIT</code>.
     * @see #setCompressionType
     */
public String getCompressionType() {
    if (!canWriteCompressed()) {
        throw new UnsupportedOperationException('Compression not supported.');
    }
    if (getCompressionMode() != MODE_EXPLICIT) {
        throw new IllegalStateException('Compression mode not MODE_EXPLICIT!');
    }
    return compressionType;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.getLocalizedCompressionTypeName()

/**
     * Returns a localized version of the name of the current
     * compression type, using the <code>Locale</code> returned by
     * <code>getLocale</code>.
     *  The default implementation checks whether compression is
     * supported and the compression mode is
     * <code>MODE_EXPLICIT</code>.  If so, if
     * <code>compressionType</code> is <code>non-null</code> the value
     * of <code>getCompressionType</code> is returned as a
     * convenience.
     * @return a <code>String</code> containing a localized version of
     * the name of the current compression type.
     * @exception UnsupportedOperationException if the writer does not
     * support compression.
     * @exception IllegalStateException if the compression mode is not
     * <code>MODE_EXPLICIT</code>.
     * @exception IllegalStateException if no compression type is set.
     */
public String getLocalizedCompressionTypeName() {
    if (!canWriteCompressed()) {
        throw new UnsupportedOperationException('Compression not supported.');
    }
    if (getCompressionMode() != MODE_EXPLICIT) {
        throw new IllegalStateException('Compression mode not MODE_EXPLICIT!');
    }
    if (getCompressionType() == null) {
        throw new IllegalStateException('No compression type set!');
    }
    return getCompressionType();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.setCompressionMode(int)

/**
     * Specifies whether compression is to be performed, and if so how
     * compression parameters are to be determined.  The <code>mode</code>
     * argument must be one of the four modes, interpreted as follows:
     * <ul>
     *   <li><code>MODE_DISABLED</code> - Do not compress.  This may
     *   not be permitted by some writers, such as JPEG, which do not
     *   normally offer uncompressed output.  The corresponding
     *   <code>set</code> and <code>get</code> methods will throw an
     *   <code>IllegalStateException</code>.
     *   <li><code>MODE_EXPLICIT</code> - Compress using the
     *   compression type and quality settings specified in this
     *   <code>ImageWriteParam</code>.  Any previously set compression
     *   parameters are discarded.
     *   <li><code>MODE_COPY_FROM_METADATA</code> - Use whatever
     *   compression parameters are specified in metadata objects
     *   passed in to the writer.
     *   <li><code>MODE_DEFAULT</code> - Use default compression
     *   parameters.
     * </ul>
     *  The default is <code>MODE_COPY_FROM_METADATA</code>.
     * @param mode The mode for setting compression in the output
     * stream.
     * @exception UnsupportedOperationException if the writer does not
     * support compression, or does not support the requested mode.
     * @exception IllegalArgumentException if <code>mode</code> is not
     * one of the modes listed above.
     * @see #getCompressionMode
     */
public void setCompressionMode(int mode) {
    if (!canWriteCompressed()) {
        throw new UnsupportedOperationException('Compression not supported.');
    }
    if (mode < MODE_DISABLED || mode > MAX_MODE) {
        throw new IllegalArgumentException('Illegal value for mode!');
    }
    this.compressionMode = mode;
    if (mode == MODE_EXPLICIT) {
        unsetCompression();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.jmx.mbeanserver.JmxMBeanServer.getMBeanInstantiator()

/**
     * Return the MBeanInstantiator associated to this MBeanServer.
     * @exception UnsupportedOperationException if 
     *            {@link MBeanServerInterceptor}s
     *            are not enabled on this object.
     * @see #interceptorsEnabled
     **/
public MBeanInstantiator getMBeanInstantiator() {
    if (interceptorsEnabled) return instantiator; else throw new UnsupportedOperationException('MBeanServerInterceptors are disabled.');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.jmx.mbeanserver.JmxMBeanServer.getMBeanServerInterceptor()

/**
     * Return the MBeanServerInterceptor.
     * @exception UnsupportedOperationException if 
     *            {@link MBeanServerInterceptor}s
     *            are not enabled on this object.
     * @see #interceptorsEnabled
     **/
public synchronized MBeanServerInterceptor getMBeanServerInterceptor() {
    if (interceptorsEnabled) return mbsInterceptor; else throw new UnsupportedOperationException('MBeanServerInterceptors are disabled.');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.jmx.mbeanserver.JmxMBeanServer.setMBeanServerInterceptor(MBeanServerInterceptor)

/**
     * Set the MBeanServerInterceptor.
     * @exception UnsupportedOperationException if 
     *            {@link MBeanServerInterceptor}s
     *            are not enabled on this object.
     * @see #interceptorsEnabled
     **/
public synchronized void setMBeanServerInterceptor(MBeanServerInterceptor interceptor) {
    if (!interceptorsEnabled) throw new UnsupportedOperationException('MBeanServerInterceptors are disabled.');
    if (interceptor == null) throw new IllegalArgumentException('MBeanServerInterceptor is null');
    mbsInterceptor = interceptor;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.loading.MLet.readExternal(ObjectInput)

/**
      * Restore this MLet's contents from the given {@link ObjectInput}.
      * Not all implementations support this method.  Those that do not
      * throw {@link UnsupportedOperationException}.  A subclass may
      * override this method to support it or to change the format of
      * the read data.
      * The format of the read data is not specified, but if an
      * implementation supports {@link #readExternal} it must also
      * support {@link #writeExternal} in such a way that what is
      * written by the latter can be read by the former.
      * @param in The object input stream to read from.
      * @exception IOException if a problem occurred while reading.
      * @exception ClassNotFoundException if the class for the object
      * being restored cannot be found.
      * @exception UnsupportedOperationException if this
      * implementation does not support this operation.
      */
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException, UnsupportedOperationException {
    throw new UnsupportedOperationException('MLet.readExternal');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.loading.MLet.writeExternal(ObjectOutput)

/**
      * Save this MLet's contents to the given {@link ObjectOutput}.
      * Not all implementations support this method.  Those that do not
      * throw {@link UnsupportedOperationException}.  A subclass may
      * override this method to support it or to change the format of
      * the written data.
      * The format of the written data is not specified, but if
      * an implementation supports {@link #writeExternal} it must
      * also support {@link #readExternal} in such a way that what is
      * written by the former can be read by the latter.
      * @param out The object output stream to write to.
      * @exception IOException If a problem occurred while writing.
      * @exception UnsupportedOperationException If this
      * implementation does not support this operation.
      */
public void writeExternal(ObjectOutput out) throws IOException, UnsupportedOperationException {
    throw new UnsupportedOperationException('MLet.writeExternal');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.net.URLStreamHandler.openConnection(URL, Proxy)

/**
     * Same as openConnection(URL), except that the connection will be
     * made through the specified proxy; Protocol handlers that do not
     * support proxing will ignore the proxy parameter and make a
     * normal connection.
     * Calling this method preempts the system's default ProxySelector
     * settings.
     * @param      u   the URL that this connects to.
     * @param      p   the proxy through which the connection will be made.
     *                 If direct connection is desired, Proxy.NO_PROXY
     *                 should be specified.
     * @return     a <code>URLConnection</code> object for the <code>URL</code>.
     * @exception  IOException  if an I/O error occurs while opening the
     *               connection.
     * @exception  IllegalArgumentException if either u or p is null,
     *               or p has the wrong type.
     * @exception  UnsupportedOperationException if the subclass that
     *               implements the protocol doesn't support this method.
     * @since      1.5
     */
protected URLConnection openConnection(URL u, Proxy p) throws IOException {
    throw new UnsupportedOperationException('Method not implemented.');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.UUID.clockSequence()

/**
     * The clock sequence value associated with this UUID.
     * The 14 bit clock sequence value is constructed from the clock
     * sequence field of this UUID. The clock sequence field is used to
     * guarantee temporal uniqueness in a time-based UUID.
     * The  clockSequence value is only meaningful in a time-based UUID, which
     * has version type 1. If this UUID is not a time-based UUID then
     * this method throws UnsupportedOperationException.
     * @return  the clock sequence of this <tt>UUID</tt>.
     * @throws UnsupportedOperationException if this UUID is not a 
     *         version 1 UUID.
     */
public int clockSequence() {
    if (version() != 1) {
        throw new UnsupportedOperationException('Not a time-based UUID');
    }
    if (sequence < 0) {
        sequence = (int) ((leastSigBits & 0x3FFF000000000000L) >>> 48);
    }
    return sequence;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.UUID.node()

/**
     * The node value associated with this UUID.
     * The 48 bit node value is constructed from the node field of
     * this UUID. This field is intended to hold the IEEE 802 address 
     * of the machine that generated this UUID to guarantee spatial
     * uniqueness.
     * The node value is only meaningful in a time-based UUID, which
     * has version type 1. If this UUID is not a time-based UUID then
     * this method throws UnsupportedOperationException.
     * @return  the node value of this <tt>UUID</tt>.
     * @throws UnsupportedOperationException if this UUID is not a
     *         version 1 UUID.
     */
public long node() {
    if (version() != 1) {
        throw new UnsupportedOperationException('Not a time-based UUID');
    }
    if (node < 0) {
        node = leastSigBits & 0x0000FFFFFFFFFFFFL;
    }
    return node;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.UUID.timestamp()

/**
     * The timestamp value associated with this UUID.
     * The 60 bit timestamp value is constructed from the time_low,
     * time_mid, and time_hi fields of this <tt>UUID</tt>. The resulting 
     * timestamp is measured in 100-nanosecond units since midnight, 
     * October 15, 1582 UTC.
     * The timestamp value is only meaningful in a time-based UUID, which
     * has version type 1. If this <tt>UUID</tt> is not a time-based UUID then
     * this method throws UnsupportedOperationException.
     * @throws UnsupportedOperationException if this UUID is not a 
     *         version 1 UUID.
     */
public long timestamp() {
    if (version() != 1) {
        throw new UnsupportedOperationException('Not a time-based UUID');
    }
    long result = timestamp;
    if (result < 0) {
        result = (mostSigBits & 0x0000000000000FFFL) << 48;
        result |= ((mostSigBits >> 16) & 0xFFFFL) << 32;
        result |= mostSigBits >>> 32;
        timestamp = result;
    }
    return result;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.Toolkit.getMouseInfoPeer()

/**
     * Obtains this toolkit's implementation of helper class for 
     * <code>MouseInfo</code> operations.
     * @return    this toolkit's implementation of  helper for <code>MouseInfo</code>
     * @throws    UnsupportedOperationException if this operation is not implemented
     * @see       java.awt.peer.MouseInfoPeer
     * @see       java.awt.MouseInfo
     */
protected MouseInfoPeer getMouseInfoPeer() {
    throw new UnsupportedOperationException('Not implemented');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.getProgressiveMode()

/**
     * Returns the current mode for writing the stream in a
     * progressive manner.
     * @return the current mode for progressive encoding.
     * @exception UnsupportedOperationException if the writer does not
     * support progressive encoding.
     * @see #setProgressiveMode
     */
public int getProgressiveMode() {
    if (!canWriteProgressive()) {
        throw new UnsupportedOperationException('Progressive output not supported');
    }
    return progressiveMode;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.setProgressiveMode(int)

/**
     * Specifies that the writer is to write the image out in a
     * progressive mode such that the stream will contain a series of
     * scans of increasing quality.  If progressive encoding is not
     * supported, an <code>UnsupportedOperationException</code> will
     * be thrown.
     *   The mode argument determines how
     * the progression parameters are chosen, and must be either
     * <code>MODE_DISABLED</code>,
     * <code>MODE_COPY_FROM_METADATA</code>, or
     * <code>MODE_DEFAULT</code>.  Otherwise an
     * <code>IllegalArgumentException</code> is thrown.
     *  The modes are interpreted as follows:
     * <ul>
     *   <li><code>MODE_DISABLED</code> - No progression.  Use this to
     *   turn off progession.
     *   <li><code>MODE_COPY_FROM_METADATA</code> - The output image
     *   will use whatever progression parameters are found in the
     *   metadata objects passed into the writer.
     *   <li><code>MODE_DEFAULT</code> - The image will be written
     *   progressively, with parameters chosen by the writer.
     * </ul>
     *  The default is <code>MODE_COPY_FROM_METADATA</code>.
     * @param mode The mode for setting progression in the output
     * stream.
     * @exception UnsupportedOperationException if the writer does not
     * support progressive encoding.
     * @exception IllegalArgumentException if <code>mode</code> is not
     * one of the modes listed above.
     * @see #getProgressiveMode
     */
public void setProgressiveMode(int mode) {
    if (!canWriteProgressive()) {
        throw new UnsupportedOperationException('Progressive output not supported');
    }
    if (mode < MODE_DISABLED || mode > MAX_MODE) {
        throw new IllegalArgumentException('Illegal value for mode!');
    }
    if (mode == MODE_EXPLICIT) {
        throw new IllegalArgumentException('MODE_EXPLICIT not supported for progressive output');
    }
    this.progressiveMode = mode;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.net.Socket.connect(SocketAddress, int)

/**
     * Connects this socket to the server with a specified timeout value.
     * A timeout of zero is interpreted as an infinite timeout. The connection
     * will then block until established or an error occurs.
     * @param endpoint the <code>SocketAddress</code>
     * @param timeout  the timeout value to be used in milliseconds.
     * @throws IOException if an error occurs during the connection
     * @throws SocketTimeoutException if timeout expires before connecting
     * @throws  java.nio.channels.IllegalBlockingModeException
     *          if this socket has an associated channel,
     *          and the channel is in non-blocking mode
     * @throws  IllegalArgumentException if endpoint is null or is a
     *          SocketAddress subclass not supported by this socket
     * @since 1.4
     * @spec JSR-51
     */
public void connect(SocketAddress endpoint, int timeout) throws IOException {
    if (endpoint == null) throw new IllegalArgumentException('connect: The address can't be null');
    if (timeout < 0) throw new IllegalArgumentException('connect: timeout can't be negative');
    if (isClosed()) throw new SocketException('Socket is closed');
    if (!oldImpl && isConnected()) throw new SocketException('already connected');
    if (!(endpoint instanceof InetSocketAddress)) throw new IllegalArgumentException('Unsupported address type');
    InetSocketAddress epoint = (InetSocketAddress) endpoint;
    SecurityManager security = System.getSecurityManager();
    if (security != null) {
        if (epoint.isUnresolved()) security.checkConnect(epoint.getHostName(), epoint.getPort()); else security.checkConnect(epoint.getAddress().getHostAddress(), epoint.getPort());
    }
    if (!created) createImpl(true);
    if (!oldImpl) impl.connect(epoint, timeout); else if (timeout == 0) {
        if (epoint.isUnresolved()) impl.connect(epoint.getAddress().getHostName(), epoint.getPort()); else impl.connect(epoint.getAddress(), epoint.getPort());
    } else throw new UnsupportedOperationException('SocketImpl.connect(addr, timeout)');
    connected = true;
    bound = true;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.parsers.DocumentBuilder.reset()

/**
   * Reset this <code>DocumentBuilder</code> to its original configuration.
   * 
   * <code>DocumentBuilder</code> is reset to the same state as when it was created with
   * {@link DocumentBuilderFactory#newDocumentBuilder()}.
   * <code>reset()</code> is designed to allow the reuse of existing <code>DocumentBuilder</code>s
   * thus saving resources associated with the creation of new <code>DocumentBuilder</code>s.
   * 
   * The reset <code>DocumentBuilder</code> is not guaranteed to have the same {@link EntityResolver} or {@link ErrorHandler}
   * <code>Object</code>s, e.g. {@link Object#equals(Object obj)}.  It is guaranteed to have a functionally equal
   * <code>EntityResolver</code> and <code>ErrorHandler</code>.
   * 
   * @since 1.5
   */
public void reset() {
    throw new UnsupportedOperationException('This DocumentBuilder, \'' + this.getClass().getName() + '\', does not support the reset functionality.' + '  Specification \'' + this.getClass().getPackage().getSpecificationTitle() + '\'' + ' version \'' + this.getClass().getPackage().getSpecificationVersion() + '\'');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.parsers.SAXParser.reset()

/**
  * Reset this <code>SAXParser</code> to its original configuration.
  * 
  * <code>SAXParser</code> is reset to the same state as when it was created with
  * {@link SAXParserFactory#newSAXParser()}.
  * <code>reset()</code> is designed to allow the reuse of existing <code>SAXParser</code>s
  * thus saving resources associated with the creation of new <code>SAXParser</code>s.
  * 
  * The reset <code>SAXParser</code> is not guaranteed to have the same {@link Schema}
  * <code>Object</code>, e.g. {@link Object#equals(Object obj)}.  It is guaranteed to have a functionally equal
  * <code>Schema</code>.
  * 
  * @since 1.5
  */
public void reset() {
    throw new UnsupportedOperationException('This SAXParser, \'' + this.getClass().getName() + '\', does not support the reset functionality.' + '  Specification \'' + this.getClass().getPackage().getSpecificationTitle() + '\'' + ' version \'' + this.getClass().getPackage().getSpecificationVersion() + '\'');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.transform.Transformer.reset()

/**
  * Reset this <code>Transformer</code> to its original configuration.
  * 
  * <code>Transformer</code> is reset to the same state as when it was created with
  * {@link TransformerFactory#newTransformer()},
  * {@link TransformerFactory#newTransformer(Source source)} or
  * {@link Templates#newTransformer()}.
  * <code>reset()</code> is designed to allow the reuse of existing <code>Transformer</code>s
  * thus saving resources associated with the creation of new <code>Transformer</code>s.
  * 
  * The reset <code>Transformer</code> is not guaranteed to have the same {@link URIResolver}
  * or {@link ErrorListener} <code>Object</code>s, e.g. {@link Object#equals(Object obj)}.
  * It is guaranteed to have a functionally equal <code>URIResolver</code>
  * and <code>ErrorListener</code>.
  * 
  * @since 1.5
  */
public void reset() {
    throw new UnsupportedOperationException('This Transformer, \'' + this.getClass().getName() + '\', does not support the reset functionality.' + '  Specification \'' + this.getClass().getPackage().getSpecificationTitle() + '\'' + ' version \'' + this.getClass().getPackage().getSpecificationVersion() + '\'');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ComponentColorModel.extractComponent(Object, int, int)

private int extractComponent(Object inData, int idx, int precision) {
    boolean needAlpha = (supportsAlpha && isAlphaPremultiplied);
    int alp = 0;
    int comp;
    int mask = (1 << nBits[idx]) - 1;
    switch(transferType) {
        case DataBuffer.TYPE_SHORT:
            {
                short sdata[] = (short[]) inData;
                float scalefactor = (float) ((1 << precision) - 1);
                if (needAlpha) {
                    short s = sdata[numColorComponents];
                    if (s != (short) 0) {
                        return (int) ((((float) sdata[idx]) / ((float) s)) * scalefactor + 0.5f);
                    } else {
                        return 0;
                    }
                } else {
                    return (int) ((sdata[idx] / 32767.0f) * scalefactor + 0.5f);
                }
            }
        case DataBuffer.TYPE_FLOAT:
            {
                float fdata[] = (float[]) inData;
                float scalefactor = (float) ((1 << precision) - 1);
                if (needAlpha) {
                    float f = fdata[numColorComponents];
                    if (f != 0.0f) {
                        return (int) (((fdata[idx] / f) * scalefactor) + 0.5f);
                    } else {
                        return 0;
                    }
                } else {
                    return (int) (fdata[idx] * scalefactor + 0.5f);
                }
            }
        case DataBuffer.TYPE_DOUBLE:
            {
                double ddata[] = (double[]) inData;
                double scalefactor = (double) ((1 << precision) - 1);
                if (needAlpha) {
                    double d = ddata[numColorComponents];
                    if (d != 0.0) {
                        return (int) (((ddata[idx] / d) * scalefactor) + 0.5);
                    } else {
                        return 0;
                    }
                } else {
                    return (int) (ddata[idx] * scalefactor + 0.5);
                }
            }
        case DataBuffer.TYPE_BYTE:
            byte bdata[] = (byte[]) inData;
            comp = bdata[idx] & mask;
            precision = 8;
            if (needAlpha) {
                alp = bdata[numColorComponents] & mask;
            }
            break;
        case DataBuffer.TYPE_USHORT:
            short usdata[] = (short[]) inData;
            comp = usdata[idx] & mask;
            if (needAlpha) {
                alp = usdata[numColorComponents] & mask;
            }
            break;
        case DataBuffer.TYPE_INT:
            int idata[] = (int[]) inData;
            comp = idata[idx];
            if (needAlpha) {
                alp = idata[numColorComponents];
            }
            break;
        default:
            throw new UnsupportedOperationException('This method has not ' + 'been implemented for transferType ' + transferType);
    }
    if (needAlpha) {
        if (alp != 0) {
            float scalefactor = (float) ((1 << precision) - 1);
            float fcomp = ((float) comp) / ((float) mask);
            float invalp = ((float) ((1 << nBits[numColorComponents]) - 1)) / ((float) alp);
            return (int) (fcomp * invalp * scalefactor + 0.5f);
        } else {
            return 0;
        }
    } else {
        if (nBits[idx] != precision) {
            float scalefactor = (float) ((1 << precision) - 1);
            float fcomp = ((float) comp) / ((float) mask);
            return (int) (fcomp * scalefactor + 0.5f);
        }
        return comp;
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ComponentColorModel.getAlpha(Object)

/**
     * Returns the alpha component for the specified pixel, scaled from
     * 0 to 255.  The pixel value is specified by an array of data
     * elements of type <CODE>transferType</CODE> passed in as an 
     * object reference.  Since <code>ComponentColorModel</code> can be
     * subclassed, subclasses inherit the
     * implementation of this method and if they don't override it then   
     * they throw an exception if they use an unsupported 
     * <code>transferType</code>.
     * @param inData The pixel from which you want to get the alpha component, 
     * specified by an array of data elements of type <CODE>transferType</CODE>.
     * @return The alpha component for the specified pixel, as an int.
     * @throws ClassCastException If <CODE>inData</CODE> is not a primitive array 
     * of type <CODE>transferType</CODE>. 
     * @throws ArrayIndexOutOfBoundsException if <CODE>inData</CODE> is not 
     * large enough to hold a pixel value for this
     * <CODE>ColorModel</CODE>.
     * @throws UnsupportedOperationException If the transfer type of 
     * this <CODE>ComponentColorModel</CODE>
     * is not one of the supported transfer types:  
     * <CODE>DataBuffer.TYPE_BYTE</CODE>, <CODE>DataBuffer.TYPE_USHORT</CODE>, 
     * <CODE>DataBuffer.TYPE_INT</CODE>, <CODE>DataBuffer.TYPE_SHORT</CODE>,
     * <CODE>DataBuffer.TYPE_FLOAT</CODE>, or <CODE>DataBuffer.TYPE_DOUBLE</CODE>.
     */
public int getAlpha(Object inData) {
    if (supportsAlpha == false) {
        return 255;
    }
    int alpha = 0;
    int aIdx = numColorComponents;
    int mask = (1 << nBits[aIdx]) - 1;
    switch(transferType) {
        case DataBuffer.TYPE_SHORT:
            short sdata[] = (short[]) inData;
            alpha = (int) ((sdata[aIdx] / 32767.0f) * 255.0f + 0.5f);
            return alpha;
        case DataBuffer.TYPE_FLOAT:
            float fdata[] = (float[]) inData;
            alpha = (int) (fdata[aIdx] * 255.0f + 0.5f);
            return alpha;
        case DataBuffer.TYPE_DOUBLE:
            double ddata[] = (double[]) inData;
            alpha = (int) (ddata[aIdx] * 255.0 + 0.5);
            return alpha;
        case DataBuffer.TYPE_BYTE:
            byte bdata[] = (byte[]) inData;
            alpha = bdata[aIdx] & mask;
            break;
        case DataBuffer.TYPE_USHORT:
            short usdata[] = (short[]) inData;
            alpha = usdata[aIdx] & mask;
            break;
        case DataBuffer.TYPE_INT:
            int idata[] = (int[]) inData;
            alpha = idata[aIdx];
            break;
        default:
            throw new UnsupportedOperationException('This method has not ' + 'been implemented for transferType ' + transferType);
    }
    if (nBits[aIdx] == 8) {
        return alpha;
    } else {
        return (int) ((((float) alpha) / ((float) ((1 << nBits[aIdx]) - 1))) * 255.0f + 0.5f);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ColorModel.getAlpha(Object)

/**
     * Returns the alpha component for the specified pixel, scaled
     * from 0 to 255.  The pixel value is specified by an array of data
     * elements of type transferType passed in as an object reference.
     * If inData is not a primitive array of type transferType, a
     * <code>ClassCastException</code> is thrown.  An
     * <code>ArrayIndexOutOfBoundsException</code> is thrown if 
     * <code>inData</code> is not large enough to hold a pixel value for
     * this <code>ColorModel</code>.
     * If this <code>transferType</code> is not supported, a
     * <code>UnsupportedOperationException</code> will be 
     * thrown.  Since
     * <code>ColorModel</code> is an abstract class, any instance
     * must be an instance of a subclass.  Subclasses inherit the
     * implementation of this method and if they don't override it, this
     * method throws an exception if the subclass uses a
     * <code>transferType</code> other than 
     * <code>DataBuffer.TYPE_BYTE</code>, 
     * <code>DataBuffer.TYPE_USHORT</code>, or  
     * <code>DataBuffer.TYPE_INT</code>.
     * @param inData the specified pixel
     * @return the alpha component of the specified pixel, scaled from
     * 0 to 255.
     * @throws ClassCastException if <code>inData</code> 
     *  is not a primitive array of type <code>transferType</code>
     * @throws ArrayIndexOutOfBoundsException if
     *  <code>inData</code> is not large enough to hold a pixel value   
     *  for this <code>ColorModel</code>
     * @throws UnsupportedOperationException if this
     *  <code>tranferType</code> is not supported by this
     *  <code>ColorModel</code>
     */
public int getAlpha(Object inData) {
    int pixel = 0, length = 0;
    switch(transferType) {
        case DataBuffer.TYPE_BYTE:
            byte bdata[] = (byte[]) inData;
            pixel = bdata[0] & 0xff;
            length = bdata.length;
            break;
        case DataBuffer.TYPE_USHORT:
            short sdata[] = (short[]) inData;
            pixel = sdata[0] & 0xffff;
            length = sdata.length;
            break;
        case DataBuffer.TYPE_INT:
            int idata[] = (int[]) inData;
            pixel = idata[0];
            length = idata.length;
            break;
        default:
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
    }
    if (length == 1) {
        return getAlpha(pixel);
    } else {
        throw new UnsupportedOperationException('This method is not supported by this color model');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ColorModel.getBlue(Object)

/**
     * Returns the blue color component for the specified pixel, scaled
     * from 0 to 255 in the default RGB <code>ColorSpace</code>, sRGB.  A
     * color conversion is done if necessary.  The pixel value is
     * specified by an array of data elements of type transferType passed
     * in as an object reference.  The returned value is a non
     * pre-multiplied value.  For example, if the alpha is premultiplied,
     * this method divides it out before returning the value.  If the
     * alpha value is 0, the blue value will be 0.  If 
     * <code>inData</code> is not a primitive array of type transferType,
     * a <code>ClassCastException</code> is thrown.  An
     * <code>ArrayIndexOutOfBoundsException</code> is
     * thrown if <code>inData</code> is not large enough to hold a pixel
     * value for this <code>ColorModel</code>.
     * If this <code>transferType</code> is not supported, a
     * <code>UnsupportedOperationException</code> will be 
     * thrown.  Since
     * <code>ColorModel</code> is an abstract class, any instance
     * must be an instance of a subclass.  Subclasses inherit the
     * implementation of this method and if they don't override it, this
     * method throws an exception if the subclass uses a
     * <code>transferType</code> other than 
     * <code>DataBuffer.TYPE_BYTE</code>, 
     * <code>DataBuffer.TYPE_USHORT</code>, or  
     * <code>DataBuffer.TYPE_INT</code>.
     * @param inData an array of pixel values
     * @return the value of the blue component of the specified pixel.
     * @throws ClassCastException if <code>inData</code>
     *  is not a primitive array of type <code>transferType</code>
     * @throws ArrayIndexOutOfBoundsException if
     *  <code>inData</code> is not large enough to hold a pixel value
     *  for this <code>ColorModel</code>
     * @throws UnsupportedOperationException if this
     *  <code>tranferType</code> is not supported by this 
     *  <code>ColorModel</code> 
     */
public int getBlue(Object inData) {
    int pixel = 0, length = 0;
    switch(transferType) {
        case DataBuffer.TYPE_BYTE:
            byte bdata[] = (byte[]) inData;
            pixel = bdata[0] & 0xff;
            length = bdata.length;
            break;
        case DataBuffer.TYPE_USHORT:
            short sdata[] = (short[]) inData;
            pixel = sdata[0] & 0xffff;
            length = sdata.length;
            break;
        case DataBuffer.TYPE_INT:
            int idata[] = (int[]) inData;
            pixel = idata[0];
            length = idata.length;
            break;
        default:
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
    }
    if (length == 1) {
        return getBlue(pixel);
    } else {
        throw new UnsupportedOperationException('This method is not supported by this color model');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ColorModel.getGreen(Object)

/**
     * Returns the green color component for the specified pixel, scaled
     * from 0 to 255 in the default RGB <code>ColorSpace</code>, sRGB.  A
     * color conversion is done if necessary.  The pixel value is
     * specified by an array of data elements of type transferType passed
     * in as an object reference.  The returned value will be a non
     * pre-multiplied value.  For example, if the alpha is premultiplied,
     * this method divides it out before returning the value.  If the
     * alpha value is 0, the green value is 0.  If <code>inData</code> is
     * not a primitive array of type transferType, a
     * <code>ClassCastException</code> is thrown.  An
     * <code>ArrayIndexOutOfBoundsException</code> is thrown if 
     * <code>inData</code> is not large enough to hold a pixel value for
     * this <code>ColorModel</code>.
     * If this <code>transferType</code> is not supported, a
     * <code>UnsupportedOperationException</code> will be
     * thrown.  Since
     * <code>ColorModel</code> is an abstract class, any instance
     * must be an instance of a subclass.  Subclasses inherit the
     * implementation of this method and if they don't override it, this
     * method throws an exception if the subclass uses a
     * <code>transferType</code> other than 
     * <code>DataBuffer.TYPE_BYTE</code>, 
     * <code>DataBuffer.TYPE_USHORT</code>, or  
     * <code>DataBuffer.TYPE_INT</code>.
     * @param inData an array of pixel values
     * @return the value of the green component of the specified pixel.
     * @throws <code>ClassCastException</code> if <code>inData</code>
     *  is not a primitive array of type <code>transferType</code>
     * @throws <code>ArrayIndexOutOfBoundsException</code> if
     *  <code>inData</code> is not large enough to hold a pixel value
     *  for this <code>ColorModel</code>
     * @throws <code>UnsupportedOperationException</code> if this
     *  <code>tranferType</code> is not supported by this 
     *  <code>ColorModel</code> 
     */
public int getGreen(Object inData) {
    int pixel = 0, length = 0;
    switch(transferType) {
        case DataBuffer.TYPE_BYTE:
            byte bdata[] = (byte[]) inData;
            pixel = bdata[0] & 0xff;
            length = bdata.length;
            break;
        case DataBuffer.TYPE_USHORT:
            short sdata[] = (short[]) inData;
            pixel = sdata[0] & 0xffff;
            length = sdata.length;
            break;
        case DataBuffer.TYPE_INT:
            int idata[] = (int[]) inData;
            pixel = idata[0];
            length = idata.length;
            break;
        default:
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
    }
    if (length == 1) {
        return getGreen(pixel);
    } else {
        throw new UnsupportedOperationException('This method is not supported by this color model');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ColorModel.getRed(Object)

/**
     * Returns the red color component for the specified pixel, scaled
     * from 0 to 255 in the default RGB <code>ColorSpace</code>, sRGB.  A
     * color conversion is done if necessary.  The pixel value is
     * specified by an array of data elements of type transferType passed
     * in as an object reference.  The returned value is a non
     * pre-multiplied value.  For example, if alpha is premultiplied,
     * this method divides it out before returning
     * the value.  If the alpha value is 0, the red value is 0.
     * If <code>inData</code> is not a primitive array of type
     * transferType, a <code>ClassCastException</code> is thrown.  An
     * <code>ArrayIndexOutOfBoundsException</code> is thrown if 
     * <code>inData</code> is not large enough to hold a pixel value for
     * this <code>ColorModel</code>.
     * If this <code>transferType</code> is not supported, a       
     * <code>UnsupportedOperationException</code> will be
     * thrown.  Since
     * <code>ColorModel</code> is an abstract class, any instance
     * must be an instance of a subclass.  Subclasses inherit the
     * implementation of this method and if they don't override it, this
     * method throws an exception if the subclass uses a
     * <code>transferType</code> other than
     * <code>DataBuffer.TYPE_BYTE</code>,
     * <code>DataBuffer.TYPE_USHORT</code>, or 
     * <code>DataBuffer.TYPE_INT</code>. 
     * @param inData an array of pixel values
     * @return the value of the red component of the specified pixel.
     * @throws ClassCastException if <code>inData</code>
     *  is not a primitive array of type <code>transferType</code>
     * @throws ArrayIndexOutOfBoundsException if
     * <code>inData</code> is not large enough to hold a pixel value
     * for this <code>ColorModel</code>
     * @throws UnsupportedOperationException if this
     * <code>tranferType</code> is not supported by this
     * <code>ColorModel</code>
     */
public int getRed(Object inData) {
    int pixel = 0, length = 0;
    switch(transferType) {
        case DataBuffer.TYPE_BYTE:
            byte bdata[] = (byte[]) inData;
            pixel = bdata[0] & 0xff;
            length = bdata.length;
            break;
        case DataBuffer.TYPE_USHORT:
            short sdata[] = (short[]) inData;
            pixel = sdata[0] & 0xffff;
            length = sdata.length;
            break;
        case DataBuffer.TYPE_INT:
            int idata[] = (int[]) inData;
            pixel = idata[0];
            length = idata.length;
            break;
        default:
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
    }
    if (length == 1) {
        return getRed(pixel);
    } else {
        throw new UnsupportedOperationException('This method is not supported by this color model');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ComponentColorModel.coerceData(WritableRaster, boolean)

/**
     * Forces the raster data to match the state specified in the
     * <CODE>isAlphaPremultiplied</CODE> variable, assuming the data 
     * is currently correctly described by this <CODE>ColorModel</CODE>.  
     * It may multiply or divide the color raster data by alpha, or 
     * do nothing if the data is in the correct state.  If the data needs 
     * to be coerced, this method also returns an instance of 
     * this <CODE>ColorModel</CODE> with
     * the <CODE>isAlphaPremultiplied</CODE> flag set appropriately.
     * Since <code>ColorModel</code> can be subclassed, subclasses inherit
     * the implementation of this method and if they don't override it
     * then they throw an exception if they use an unsupported 
     * <code>transferType</code>.
     * @throws NullPointerException if <code>raster</code> is 
     * <code>null</code> and data coercion is required.
     * @throws UnsupportedOperationException if the transfer type of 
     * this <CODE>ComponentColorModel</CODE>
     * is not one of the supported transfer types:  
     * <CODE>DataBuffer.TYPE_BYTE</CODE>, <CODE>DataBuffer.TYPE_USHORT</CODE>, 
     * <CODE>DataBuffer.TYPE_INT</CODE>, <CODE>DataBuffer.TYPE_SHORT</CODE>,
     * <CODE>DataBuffer.TYPE_FLOAT</CODE>, or <CODE>DataBuffer.TYPE_DOUBLE</CODE>.
     */
public ColorModel coerceData(WritableRaster raster, boolean isAlphaPremultiplied) {
    if ((supportsAlpha == false) || (this.isAlphaPremultiplied == isAlphaPremultiplied)) {
        return this;
    }
    int w = raster.getWidth();
    int h = raster.getHeight();
    int aIdx = raster.getNumBands() - 1;
    float normAlpha;
    int rminX = raster.getMinX();
    int rY = raster.getMinY();
    int rX;
    if (isAlphaPremultiplied) {
        switch(transferType) {
            case DataBuffer.TYPE_BYTE:
                {
                    byte pixel[] = null;
                    byte zpixel[] = null;
                    float alphaScale = 1.0f / ((float) ((1 << nBits[aIdx]) - 1));
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = (byte[]) raster.getDataElements(rX, rY, pixel);
                            normAlpha = (pixel[aIdx] & 0xff) * alphaScale;
                            if (normAlpha != 0.0f) {
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] = (byte) ((pixel[c] & 0xff) * normAlpha + 0.5f);
                                }
                                raster.setDataElements(rX, rY, pixel);
                            } else {
                                if (zpixel == null) {
                                    zpixel = new byte[numComponents];
                                    java.util.Arrays.fill(zpixel, (byte) 0);
                                }
                                raster.setDataElements(rX, rY, zpixel);
                            }
                        }
                    }
                }
                break;
            case DataBuffer.TYPE_USHORT:
                {
                    short pixel[] = null;
                    short zpixel[] = null;
                    float alphaScale = 1.0f / ((float) ((1 << nBits[aIdx]) - 1));
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = (short[]) raster.getDataElements(rX, rY, pixel);
                            normAlpha = (pixel[aIdx] & 0xffff) * alphaScale;
                            if (normAlpha != 0.0f) {
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] = (short) ((pixel[c] & 0xffff) * normAlpha + 0.5f);
                                }
                                raster.setDataElements(rX, rY, pixel);
                            } else {
                                if (zpixel == null) {
                                    zpixel = new short[numComponents];
                                    java.util.Arrays.fill(zpixel, (short) 0);
                                }
                                raster.setDataElements(rX, rY, zpixel);
                            }
                        }
                    }
                }
                break;
            case DataBuffer.TYPE_INT:
                {
                    int pixel[] = null;
                    int zpixel[] = null;
                    float alphaScale = 1.0f / ((float) ((1 << nBits[aIdx]) - 1));
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = (int[]) raster.getDataElements(rX, rY, pixel);
                            normAlpha = pixel[aIdx] * alphaScale;
                            if (normAlpha != 0.0f) {
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] = (int) (pixel[c] * normAlpha + 0.5f);
                                }
                                raster.setDataElements(rX, rY, pixel);
                            } else {
                                if (zpixel == null) {
                                    zpixel = new int[numComponents];
                                    java.util.Arrays.fill(zpixel, 0);
                                }
                                raster.setDataElements(rX, rY, zpixel);
                            }
                        }
                    }
                }
                break;
            case DataBuffer.TYPE_SHORT:
                {
                    short pixel[] = null;
                    short zpixel[] = null;
                    float alphaScale = 1.0f / 32767.0f;
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = (short[]) raster.getDataElements(rX, rY, pixel);
                            normAlpha = pixel[aIdx] * alphaScale;
                            if (normAlpha != 0.0f) {
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] = (short) (pixel[c] * normAlpha + 0.5f);
                                }
                                raster.setDataElements(rX, rY, pixel);
                            } else {
                                if (zpixel == null) {
                                    zpixel = new short[numComponents];
                                    java.util.Arrays.fill(zpixel, (short) 0);
                                }
                                raster.setDataElements(rX, rY, zpixel);
                            }
                        }
                    }
                }
                break;
            case DataBuffer.TYPE_FLOAT:
                {
                    float pixel[] = null;
                    float zpixel[] = null;
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = (float[]) raster.getDataElements(rX, rY, pixel);
                            normAlpha = pixel[aIdx];
                            if (normAlpha != 0.0f) {
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] *= normAlpha;
                                }
                                raster.setDataElements(rX, rY, pixel);
                            } else {
                                if (zpixel == null) {
                                    zpixel = new float[numComponents];
                                    java.util.Arrays.fill(zpixel, 0.0f);
                                }
                                raster.setDataElements(rX, rY, zpixel);
                            }
                        }
                    }
                }
                break;
            case DataBuffer.TYPE_DOUBLE:
                {
                    double pixel[] = null;
                    double zpixel[] = null;
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = (double[]) raster.getDataElements(rX, rY, pixel);
                            double dnormAlpha = pixel[aIdx];
                            if (dnormAlpha != 0.0) {
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] *= dnormAlpha;
                                }
                                raster.setDataElements(rX, rY, pixel);
                            } else {
                                if (zpixel == null) {
                                    zpixel = new double[numComponents];
                                    java.util.Arrays.fill(zpixel, 0.0);
                                }
                                raster.setDataElements(rX, rY, zpixel);
                            }
                        }
                    }
                }
                break;
            default:
                throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
        }
    } else {
        switch(transferType) {
            case DataBuffer.TYPE_BYTE:
                {
                    byte pixel[] = null;
                    float alphaScale = 1.0f / ((float) ((1 << nBits[aIdx]) - 1));
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = (byte[]) raster.getDataElements(rX, rY, pixel);
                            normAlpha = (pixel[aIdx] & 0xff) * alphaScale;
                            if (normAlpha != 0.0f) {
                                float invAlpha = 1.0f / normAlpha;
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] = (byte) ((pixel[c] & 0xff) * invAlpha + 0.5f);
                                }
                                raster.setDataElements(rX, rY, pixel);
                            }
                        }
                    }
                }
                break;
            case DataBuffer.TYPE_USHORT:
                {
                    short pixel[] = null;
                    float alphaScale = 1.0f / ((float) ((1 << nBits[aIdx]) - 1));
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = (short[]) raster.getDataElements(rX, rY, pixel);
                            normAlpha = (pixel[aIdx] & 0xffff) * alphaScale;
                            if (normAlpha != 0.0f) {
                                float invAlpha = 1.0f / normAlpha;
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] = (short) ((pixel[c] & 0xffff) * invAlpha + 0.5f);
                                }
                                raster.setDataElements(rX, rY, pixel);
                            }
                        }
                    }
                }
                break;
            case DataBuffer.TYPE_INT:
                {
                    int pixel[] = null;
                    float alphaScale = 1.0f / ((float) ((1 << nBits[aIdx]) - 1));
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = (int[]) raster.getDataElements(rX, rY, pixel);
                            normAlpha = pixel[aIdx] * alphaScale;
                            if (normAlpha != 0.0f) {
                                float invAlpha = 1.0f / normAlpha;
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] = (int) (pixel[c] * invAlpha + 0.5f);
                                }
                                raster.setDataElements(rX, rY, pixel);
                            }
                        }
                    }
                }
                break;
            case DataBuffer.TYPE_SHORT:
                {
                    short pixel[] = null;
                    float alphaScale = 1.0f / 32767.0f;
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = (short[]) raster.getDataElements(rX, rY, pixel);
                            normAlpha = pixel[aIdx] * alphaScale;
                            if (normAlpha != 0.0f) {
                                float invAlpha = 1.0f / normAlpha;
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] = (short) (pixel[c] * invAlpha + 0.5f);
                                }
                                raster.setDataElements(rX, rY, pixel);
                            }
                        }
                    }
                }
                break;
            case DataBuffer.TYPE_FLOAT:
                {
                    float pixel[] = null;
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = (float[]) raster.getDataElements(rX, rY, pixel);
                            normAlpha = pixel[aIdx];
                            if (normAlpha != 0.0f) {
                                float invAlpha = 1.0f / normAlpha;
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] *= invAlpha;
                                }
                                raster.setDataElements(rX, rY, pixel);
                            }
                        }
                    }
                }
                break;
            case DataBuffer.TYPE_DOUBLE:
                {
                    double pixel[] = null;
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = (double[]) raster.getDataElements(rX, rY, pixel);
                            double dnormAlpha = pixel[aIdx];
                            if (dnormAlpha != 0.0) {
                                double invAlpha = 1.0 / dnormAlpha;
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] *= invAlpha;
                                }
                                raster.setDataElements(rX, rY, pixel);
                            }
                        }
                    }
                }
                break;
            default:
                throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
        }
    }
    if (!signed) {
        return new ComponentColorModel(colorSpace, nBits, supportsAlpha, isAlphaPremultiplied, transparency, transferType);
    } else {
        return new ComponentColorModel(colorSpace, supportsAlpha, isAlphaPremultiplied, transparency, transferType);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ComponentColorModel.getComponents(Object, int[], int)

/**
     * Returns an array of unnormalized color/alpha components given a pixel
     * in this <CODE>ColorModel</CODE>.  The pixel value is specified by an 
     * array of data elements of type <CODE>transferType</CODE> passed in as  
     * an object reference. 
     * An IllegalArgumentException is thrown if the component values for this
     * <CODE>ColorModel</CODE> are not conveniently representable in the
     * unnormalized form.
     * Color/alpha components are stored in the <CODE>components</CODE> array 
     * starting at  <CODE>offset</CODE> (even if the array is allocated by 
     * this method).  Since <code>ComponentColorModel</code> can be
     * subclassed, subclasses inherit the
     * implementation of this method and if they don't override it then   
     * this method might throw an exception if they use an unsupported 
     * <code>transferType</code>.
     * @param pixel A pixel value specified by an array of data elements of
     * type <CODE>transferType</CODE>.
     * @param components An integer array in which to store the unnormalized 
     * color/alpha components. If the <CODE>components</CODE> array is null, 
     * a new array is allocated. 
     * @param offset An offset into the <CODE>components</CODE> array.
     * @return The <CODE>components</CODE> array.
     * @throws IllegalArgumentException If this
     * <CODE>ComponentColorModel</CODE> does not support the unnormalized form
     * @throws UnsupportedOperationException in some cases iff the
     * transfer type of this <CODE>ComponentColorModel</CODE>
     * is not one of the following transfer types:  
     * <CODE>DataBuffer.TYPE_BYTE</CODE>, <CODE>DataBuffer.TYPE_USHORT</CODE>, 
     * or <CODE>DataBuffer.TYPE_INT</CODE>.
     * @throws ClassCastException If <CODE>pixel</CODE> is not a primitive 
     * array of type <CODE>transferType</CODE>.
     * @throws IllegalArgumentException If the <CODE>components</CODE> array is 
     * not null and is not large enough to hold all the color and alpha 
     * components (starting at offset), or if <CODE>pixel</CODE> is not large 
     * enough to hold a pixel value for this ColorModel.
     */
public int[] getComponents(Object pixel, int[] components, int offset) {
    int intpixel[];
    if (needScaleInit) {
        initScale();
    }
    if (noUnnorm) {
        throw new IllegalArgumentException('This ColorModel does not support the unnormalized form');
    }
    if (pixel instanceof int[]) {
        intpixel = (int[]) pixel;
    } else {
        intpixel = DataBuffer.toIntArray(pixel);
        if (intpixel == null) {
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
        }
    }
    if (intpixel.length < numComponents) {
        throw new IllegalArgumentException('Length of pixel array < number of components in model');
    }
    if (components == null) {
        components = new int[offset + numComponents];
    } else if ((components.length - offset) < numComponents) {
        throw new IllegalArgumentException('Length of components array < number of components in model');
    }
    System.arraycopy(intpixel, 0, components, offset, numComponents);
    return components;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ComponentColorModel.getDataElement(float[], int)

/**
     * Returns a pixel value represented as an <code>int</code> in this
     * <code>ColorModel</code>, given an array of normalized color/alpha
     * components.  This method will throw an
     * <code>IllegalArgumentException</code> if pixel values for this
     * <code>ColorModel</code> are not conveniently representable as a
     * single <code>int</code>.  An
     * <code>ArrayIndexOutOfBoundsException</code> is thrown if  the
     * <code>normComponents</code> array is not large enough to hold all the
     * color and alpha components (starting at <code>normOffset</code>).
     * @param normComponents an array of normalized color and alpha
     * components
     * @param normOffset the index into <code>normComponents</code> at which to
     * begin retrieving the color and alpha components
     * @return an <code>int</code> pixel value in this
     * <code>ColorModel</code> corresponding to the specified components.
     * @throws IllegalArgumentException if
     *  pixel values for this <code>ColorModel</code> are not
     *  conveniently representable as a single <code>int</code>
     * @throws ArrayIndexOutOfBoundsException if
     *  the <code>normComponents</code> array is not large enough to
     *  hold all of the color and alpha components starting at
     *  <code>normOffset</code>
     * @since 1.4
     */
public int getDataElement(float[] normComponents, int normOffset) {
    if (numComponents > 1) {
        throw new IllegalArgumentException('More than one component per pixel');
    }
    if (signed) {
        throw new IllegalArgumentException('Component value is signed');
    }
    if (needScaleInit) {
        initScale();
    }
    Object pixel = getDataElements(normComponents, normOffset, null);
    switch(transferType) {
        case DataBuffer.TYPE_BYTE:
            {
                byte bpixel[] = (byte[]) pixel;
                return bpixel[0] & 0xff;
            }
        case DataBuffer.TYPE_USHORT:
            {
                short[] uspixel = (short[]) pixel;
                return uspixel[0] & 0xffff;
            }
        case DataBuffer.TYPE_INT:
            {
                int[] ipixel = (int[]) pixel;
                return ipixel[0];
            }
        default:
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ComponentColorModel.getDataElements(float[], int, Object)

/**
     * Returns a data element array representation of a pixel in this
     * <code>ColorModel</code>, given an array of normalized color/alpha
     * components.  This array can then be passed to the
     * <code>setDataElements</code> method of a <code>WritableRaster</code>
     * object.  An <code>ArrayIndexOutOfBoundsException</code> is thrown
     * if the <code>normComponents</code> array is not large enough to hold
     * all the color and alpha components (starting at
     * <code>normOffset</code>).  If the <code>obj</code> variable is
     * <code>null</code>, a new array will be allocated.  If
     * <code>obj</code> is not <code>null</code>, it must be a primitive
     * array of type transferType; otherwise, a
     * <code>ClassCastException</code> is thrown.  An
     * <code>ArrayIndexOutOfBoundsException</code> is thrown if
     * <code>obj</code> is not large enough to hold a pixel value for this
     * <code>ColorModel</code>.
     * @param normComponents an array of normalized color and alpha
     * components
     * @param normOffset the index into <code>normComponents</code> at which to
     * begin retrieving color and alpha components
     * @param obj a primitive data array to hold the returned pixel
     * @return an <code>Object</code> which is a primitive data array
     * representation of a pixel
     * @throws ClassCastException if <code>obj</code>
     *  is not a primitive array of type <code>transferType</code>
     * @throws ArrayIndexOutOfBoundsException if
     *  <code>obj</code> is not large enough to hold a pixel value
     *  for this <code>ColorModel</code> or the <code>normComponents</code>
     *  array is not large enough to hold all of the color and alpha
     *  components starting at <code>normOffset</code>
     * @see WritableRaster#setDataElements
     * @see SampleModel#setDataElements
     * @since 1.4
     */
public Object getDataElements(float[] normComponents, int normOffset, Object obj) {
    boolean needAlpha = supportsAlpha && isAlphaPremultiplied;
    float[] stdNormComponents;
    if (needScaleInit) {
        initScale();
    }
    if (nonStdScale) {
        stdNormComponents = new float[numComponents];
        for (int c = 0, nc = normOffset; c < numColorComponents; c++, nc++) {
            stdNormComponents[c] = (normComponents[nc] - compOffset[c]) * compScale[c];
            if (stdNormComponents[c] < 0.0f) {
                stdNormComponents[c] = 0.0f;
            }
            if (stdNormComponents[c] > 1.0f) {
                stdNormComponents[c] = 1.0f;
            }
        }
        if (supportsAlpha) {
            stdNormComponents[numColorComponents] = normComponents[numColorComponents + normOffset];
        }
        normOffset = 0;
    } else {
        stdNormComponents = normComponents;
    }
    switch(transferType) {
        case DataBuffer.TYPE_BYTE:
            byte[] bpixel;
            if (obj == null) {
                bpixel = new byte[numComponents];
            } else {
                bpixel = (byte[]) obj;
            }
            if (needAlpha) {
                float alpha = stdNormComponents[numColorComponents + normOffset];
                for (int c = 0, nc = normOffset; c < numColorComponents; c++, nc++) {
                    bpixel[c] = (byte) ((stdNormComponents[nc] * alpha) * ((float) ((1 << nBits[c]) - 1)) + 0.5f);
                }
                bpixel[numColorComponents] = (byte) (alpha * ((float) ((1 << nBits[numColorComponents]) - 1)) + 0.5f);
            } else {
                for (int c = 0, nc = normOffset; c < numComponents; c++, nc++) {
                    bpixel[c] = (byte) (stdNormComponents[nc] * ((float) ((1 << nBits[c]) - 1)) + 0.5f);
                }
            }
            return bpixel;
        case DataBuffer.TYPE_USHORT:
            short[] uspixel;
            if (obj == null) {
                uspixel = new short[numComponents];
            } else {
                uspixel = (short[]) obj;
            }
            if (needAlpha) {
                float alpha = stdNormComponents[numColorComponents + normOffset];
                for (int c = 0, nc = normOffset; c < numColorComponents; c++, nc++) {
                    uspixel[c] = (short) ((stdNormComponents[nc] * alpha) * ((float) ((1 << nBits[c]) - 1)) + 0.5f);
                }
                uspixel[numColorComponents] = (short) (alpha * ((float) ((1 << nBits[numColorComponents]) - 1)) + 0.5f);
            } else {
                for (int c = 0, nc = normOffset; c < numComponents; c++, nc++) {
                    uspixel[c] = (short) (stdNormComponents[nc] * ((float) ((1 << nBits[c]) - 1)) + 0.5f);
                }
            }
            return uspixel;
        case DataBuffer.TYPE_INT:
            int[] ipixel;
            if (obj == null) {
                ipixel = new int[numComponents];
            } else {
                ipixel = (int[]) obj;
            }
            if (needAlpha) {
                float alpha = stdNormComponents[numColorComponents + normOffset];
                for (int c = 0, nc = normOffset; c < numColorComponents; c++, nc++) {
                    ipixel[c] = (int) ((stdNormComponents[nc] * alpha) * ((float) ((1 << nBits[c]) - 1)) + 0.5f);
                }
                ipixel[numColorComponents] = (int) (alpha * ((float) ((1 << nBits[numColorComponents]) - 1)) + 0.5f);
            } else {
                for (int c = 0, nc = normOffset; c < numComponents; c++, nc++) {
                    ipixel[c] = (int) (stdNormComponents[nc] * ((float) ((1 << nBits[c]) - 1)) + 0.5f);
                }
            }
            return ipixel;
        case DataBuffer.TYPE_SHORT:
            short[] spixel;
            if (obj == null) {
                spixel = new short[numComponents];
            } else {
                spixel = (short[]) obj;
            }
            if (needAlpha) {
                float alpha = stdNormComponents[numColorComponents + normOffset];
                for (int c = 0, nc = normOffset; c < numColorComponents; c++, nc++) {
                    spixel[c] = (short) (stdNormComponents[nc] * alpha * 32767.0f + 0.5f);
                }
                spixel[numColorComponents] = (short) (alpha * 32767.0f + 0.5f);
            } else {
                for (int c = 0, nc = normOffset; c < numComponents; c++, nc++) {
                    spixel[c] = (short) (stdNormComponents[nc] * 32767.0f + 0.5f);
                }
            }
            return spixel;
        case DataBuffer.TYPE_FLOAT:
            float[] fpixel;
            if (obj == null) {
                fpixel = new float[numComponents];
            } else {
                fpixel = (float[]) obj;
            }
            if (needAlpha) {
                float alpha = normComponents[numColorComponents + normOffset];
                for (int c = 0, nc = normOffset; c < numColorComponents; c++, nc++) {
                    fpixel[c] = normComponents[nc] * alpha;
                }
                fpixel[numColorComponents] = alpha;
            } else {
                for (int c = 0, nc = normOffset; c < numComponents; c++, nc++) {
                    fpixel[c] = normComponents[nc];
                }
            }
            return fpixel;
        case DataBuffer.TYPE_DOUBLE:
            double[] dpixel;
            if (obj == null) {
                dpixel = new double[numComponents];
            } else {
                dpixel = (double[]) obj;
            }
            if (needAlpha) {
                double alpha = (double) (normComponents[numColorComponents + normOffset]);
                for (int c = 0, nc = normOffset; c < numColorComponents; c++, nc++) {
                    dpixel[c] = normComponents[nc] * alpha;
                }
                dpixel[numColorComponents] = alpha;
            } else {
                for (int c = 0, nc = normOffset; c < numComponents; c++, nc++) {
                    dpixel[c] = (double) normComponents[nc];
                }
            }
            return dpixel;
        default:
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ComponentColorModel.getDataElements(int[], int, Object)

/**
     * Returns a data element array representation of a pixel in this
     * <CODE>ColorModel</CODE>, given an array of unnormalized color/alpha 
     * components. This array can then be passed to the <CODE>setDataElements</CODE> 
     * method of a <CODE>WritableRaster</CODE> object.
     * @param components An array of unnormalized color/alpha components.
     * @param offset The integer offset into the <CODE>components</CODE> array.
     * @param obj The object in which to store the data element array 
     * representation of the pixel. If <CODE>obj</CODE> variable is null, 
     * a new array is allocated.  If <CODE>obj</CODE> is not null, it must 
     * be a primitive array of type <CODE>transferType</CODE>. An 
     * <CODE>ArrayIndexOutOfBoundsException</CODE> is thrown if 
     * <CODE>obj</CODE> is not large enough to hold a pixel value 
     * for this <CODE>ColorModel</CODE>.  Since
     * <code>ComponentColorModel</code> can be subclassed, subclasses
     * inherit the implementation of this method and if they don't
     * override it then they throw an exception if they use an 
     * unsupported <code>transferType</code>.
     * @return The data element array representation of a pixel 
     * in this <CODE>ColorModel</CODE>.
     * @throws IllegalArgumentException If the components array
     * is not large enough to hold all the color and alpha components
     * (starting at offset).  
     * @throws ClassCastException If <CODE>obj</CODE> is not null and is not a 
     * primitive  array of type <CODE>transferType</CODE>.
     * @throws ArrayIndexOutOfBoundsException If <CODE>obj</CODE> is not large
     * enough to hold a pixel value for this <CODE>ColorModel</CODE>.    
     * @throws IllegalArgumentException If this
     * <CODE>ComponentColorModel</CODE> does not support the unnormalized form
     * @throws UnsupportedOperationException If the transfer type of 
     * this <CODE>ComponentColorModel</CODE>
     * is not one of the following transfer types:  
     * <CODE>DataBuffer.TYPE_BYTE</CODE>, <CODE>DataBuffer.TYPE_USHORT</CODE>, 
     * or <CODE>DataBuffer.TYPE_INT</CODE>.
     * @see WritableRaster#setDataElements
     * @see SampleModel#setDataElements
     */
public Object getDataElements(int[] components, int offset, Object obj) {
    if (needScaleInit) {
        initScale();
    }
    if (noUnnorm) {
        throw new IllegalArgumentException('This ColorModel does not support the unnormalized form');
    }
    if ((components.length - offset) < numComponents) {
        throw new IllegalArgumentException('Component array too small' + ' (should be ' + numComponents);
    }
    switch(transferType) {
        case DataBuffer.TYPE_INT:
            {
                int[] pixel;
                if (obj == null) {
                    pixel = new int[numComponents];
                } else {
                    pixel = (int[]) obj;
                }
                System.arraycopy(components, offset, pixel, 0, numComponents);
                return pixel;
            }
        case DataBuffer.TYPE_BYTE:
            {
                byte[] pixel;
                if (obj == null) {
                    pixel = new byte[numComponents];
                } else {
                    pixel = (byte[]) obj;
                }
                for (int i = 0; i < numComponents; i++) {
                    pixel[i] = (byte) (components[offset + i] & 0xff);
                }
                return pixel;
            }
        case DataBuffer.TYPE_USHORT:
            {
                short[] pixel;
                if (obj == null) {
                    pixel = new short[numComponents];
                } else {
                    pixel = (short[]) obj;
                }
                for (int i = 0; i < numComponents; i++) {
                    pixel[i] = (short) (components[offset + i] & 0xffff);
                }
                return pixel;
            }
        default:
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ComponentColorModel.getNormalizedComponents(Object, float[], int)

/**
     * Returns an array of all of the color/alpha components in normalized
     * form, given a pixel in this <code>ColorModel</code>.  The pixel
     * value is specified by an array of data elements of type transferType
     * passed in as an object reference.  If pixel is not a primitive array
     * of type transferType, a <code>ClassCastException</code> is thrown.
     * An <code>ArrayIndexOutOfBoundsException</code> is thrown if
     * <code>pixel</code> is not large enough to hold a pixel value for this
     * <code>ColorModel</code>.
     * Normalized components are float values between a per component minimum
     * and maximum specified by the <code>ColorSpace</code> object for this
     * <code>ColorModel</code>.  If the
     * <code>normComponents</code> array is <code>null</code>, a new array
     * will be allocated.  The <code>normComponents</code> array
     * will be returned.  Color/alpha components are stored in the
     * <code>normComponents</code> array starting at
     * <code>normOffset</code> (even if the array is allocated by this
     * method).  An <code>ArrayIndexOutOfBoundsException</code> is thrown
     * if the <code>normComponents</code> array is not <code>null</code>
     * and is not large enough to hold all the color and alpha components
     * (starting at <code>normOffset</code>).
     * This method must be overrridden by a subclass if that subclass
     * is designed to translate pixel sample values to color component values
     * in a non-default way.  The default translations implemented by this
     * class is described in the class comments.  Any subclass implementing
     * a non-default translation must follow the constraints on allowable
     * translations defined there.
     * @param pixel the specified pixel
     * @param normComponents an array to receive the normalized components
     * @param normOffset the offset into the <code>normComponents</code>
     * array at which to start storing normalized components
     * @return an array containing normalized color and alpha
     * components.
     * @throws ClassCastException if <code>pixel</code> is not a primitive
     *          array of type transferType
     * @throws ArrayIndexOutOfBoundsException if
     *          <code>normComponents</code> is not large enough to hold all
     *          color and alpha components starting at <code>normOffset</code>
     * @throws ArrayIndexOutOfBoundsException if
     *          <code>pixel</code> is not large enough to hold a pixel
     *          value for this <code>ColorModel</code>.
     * @since 1.4
     */
public float[] getNormalizedComponents(Object pixel, float[] normComponents, int normOffset) {
    if (normComponents == null) {
        normComponents = new float[numComponents + normOffset];
    }
    switch(transferType) {
        case DataBuffer.TYPE_BYTE:
            byte[] bpixel = (byte[]) pixel;
            for (int c = 0, nc = normOffset; c < numComponents; c++, nc++) {
                normComponents[nc] = ((float) (bpixel[c] & 0xff)) / ((float) ((1 << nBits[c]) - 1));
            }
            break;
        case DataBuffer.TYPE_USHORT:
            short[] uspixel = (short[]) pixel;
            for (int c = 0, nc = normOffset; c < numComponents; c++, nc++) {
                normComponents[nc] = ((float) (uspixel[c] & 0xffff)) / ((float) ((1 << nBits[c]) - 1));
            }
            break;
        case DataBuffer.TYPE_INT:
            int[] ipixel = (int[]) pixel;
            for (int c = 0, nc = normOffset; c < numComponents; c++, nc++) {
                normComponents[nc] = ((float) ipixel[c]) / ((float) ((1 << nBits[c]) - 1));
            }
            break;
        case DataBuffer.TYPE_SHORT:
            short[] spixel = (short[]) pixel;
            for (int c = 0, nc = normOffset; c < numComponents; c++, nc++) {
                normComponents[nc] = ((float) spixel[c]) / 32767.0f;
            }
            break;
        case DataBuffer.TYPE_FLOAT:
            float[] fpixel = (float[]) pixel;
            for (int c = 0, nc = normOffset; c < numComponents; c++, nc++) {
                normComponents[nc] = fpixel[c];
            }
            break;
        case DataBuffer.TYPE_DOUBLE:
            double[] dpixel = (double[]) pixel;
            for (int c = 0, nc = normOffset; c < numComponents; c++, nc++) {
                normComponents[nc] = (float) dpixel[c];
            }
            break;
        default:
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
    }
    if (supportsAlpha && isAlphaPremultiplied) {
        float alpha = normComponents[numColorComponents + normOffset];
        if (alpha != 0.0f) {
            float invAlpha = 1.0f / alpha;
            for (int c = normOffset; c < numColorComponents + normOffset; c++) {
                normComponents[c] *= invAlpha;
            }
        }
    }
    if (min != null) {
        for (int c = 0; c < numColorComponents; c++) {
            normComponents[c + normOffset] = min[c] + diffMinMax[c] * normComponents[c + normOffset];
        }
    }
    return normComponents;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.DirectColorModel.coerceData(WritableRaster, boolean)

/**
     * Forces the raster data to match the state specified in the
     * <code>isAlphaPremultiplied</code> variable, assuming the data is
     * currently correctly described by this <code>ColorModel</code>.  It
     * may multiply or divide the color raster data by alpha, or do
     * nothing if the data is in the correct state.  If the data needs to
     * be coerced, this method will also return an instance of this
     * <code>ColorModel</code> with the <code>isAlphaPremultiplied</code> 
     * flag set appropriately.  This method will throw a
     * <code>UnsupportedOperationException</code> if this transferType is
     * not supported by this <code>ColorModel</code>.  Since
     * <code>ColorModel</code> can be subclassed, subclasses inherit the
     * implementation of this method and if they don't override it then
     * they throw an exception if they use an unsupported transferType.
     * @param raster the <code>WritableRaster</code> data
     * @param isAlphaPremultiplied <code>true</code> if the alpha is
     * premultiplied; <code>false</code> otherwise
     * @return a <code>ColorModel</code> object that represents the
     * coerced data.
     * @exception UnsupportedOperationException if this 
     *            <code>transferType</code> is not supported by this
     *            color model
     */
public final ColorModel coerceData(WritableRaster raster, boolean isAlphaPremultiplied) {
    if (!supportsAlpha || this.isAlphaPremultiplied() == isAlphaPremultiplied) {
        return this;
    }
    int w = raster.getWidth();
    int h = raster.getHeight();
    int aIdx = numColorComponents;
    float normAlpha;
    float alphaScale = 1.0f / ((float) ((1 << nBits[aIdx]) - 1));
    int rminX = raster.getMinX();
    int rY = raster.getMinY();
    int rX;
    int pixel[] = null;
    int zpixel[] = null;
    if (isAlphaPremultiplied) {
        switch(transferType) {
            case DataBuffer.TYPE_BYTE:
                {
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = raster.getPixel(rX, rY, pixel);
                            normAlpha = pixel[aIdx] * alphaScale;
                            if (normAlpha != 0.f) {
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] = (int) (pixel[c] * normAlpha + 0.5f);
                                }
                                raster.setPixel(rX, rY, pixel);
                            } else {
                                if (zpixel == null) {
                                    zpixel = new int[numComponents];
                                    java.util.Arrays.fill(zpixel, 0);
                                }
                                raster.setPixel(rX, rY, zpixel);
                            }
                        }
                    }
                }
                break;
            case DataBuffer.TYPE_USHORT:
                {
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = raster.getPixel(rX, rY, pixel);
                            normAlpha = pixel[aIdx] * alphaScale;
                            if (normAlpha != 0.f) {
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] = (int) (pixel[c] * normAlpha + 0.5f);
                                }
                                raster.setPixel(rX, rY, pixel);
                            } else {
                                if (zpixel == null) {
                                    zpixel = new int[numComponents];
                                    java.util.Arrays.fill(zpixel, 0);
                                }
                                raster.setPixel(rX, rY, zpixel);
                            }
                        }
                    }
                }
                break;
            case DataBuffer.TYPE_INT:
                {
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = raster.getPixel(rX, rY, pixel);
                            normAlpha = pixel[aIdx] * alphaScale;
                            if (normAlpha != 0.f) {
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] = (int) (pixel[c] * normAlpha + 0.5f);
                                }
                                raster.setPixel(rX, rY, pixel);
                            } else {
                                if (zpixel == null) {
                                    zpixel = new int[numComponents];
                                    java.util.Arrays.fill(zpixel, 0);
                                }
                                raster.setPixel(rX, rY, zpixel);
                            }
                        }
                    }
                }
                break;
            default:
                throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
        }
    } else {
        switch(transferType) {
            case DataBuffer.TYPE_BYTE:
                {
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = raster.getPixel(rX, rY, pixel);
                            normAlpha = pixel[aIdx] * alphaScale;
                            if (normAlpha != 0.0f) {
                                float invAlpha = 1.0f / normAlpha;
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] = (int) (pixel[c] * invAlpha + 0.5f);
                                }
                                raster.setPixel(rX, rY, pixel);
                            }
                        }
                    }
                }
                break;
            case DataBuffer.TYPE_USHORT:
                {
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = raster.getPixel(rX, rY, pixel);
                            normAlpha = pixel[aIdx] * alphaScale;
                            if (normAlpha != 0) {
                                float invAlpha = 1.0f / normAlpha;
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] = (int) (pixel[c] * invAlpha + 0.5f);
                                }
                                raster.setPixel(rX, rY, pixel);
                            }
                        }
                    }
                }
                break;
            case DataBuffer.TYPE_INT:
                {
                    for (int y = 0; y < h; y++, rY++) {
                        rX = rminX;
                        for (int x = 0; x < w; x++, rX++) {
                            pixel = raster.getPixel(rX, rY, pixel);
                            normAlpha = pixel[aIdx] * alphaScale;
                            if (normAlpha != 0) {
                                float invAlpha = 1.0f / normAlpha;
                                for (int c = 0; c < aIdx; c++) {
                                    pixel[c] = (int) (pixel[c] * invAlpha + 0.5f);
                                }
                                raster.setPixel(rX, rY, pixel);
                            }
                        }
                    }
                }
                break;
            default:
                throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
        }
    }
    return new DirectColorModel(colorSpace, pixel_bits, maskArray[0], maskArray[1], maskArray[2], maskArray[3], isAlphaPremultiplied, transferType);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.DirectColorModel.getAlpha(Object)

/**
     * Returns the alpha component for the specified pixel, scaled
     * from 0 to 255.  The pixel value is specified by an array of data
     * elements of type <code>transferType</code> passed in as an object
     * reference.
     * If <code>inData</code> is not a primitive array of type 
     * <code>transferType</code>, a <code>ClassCastException</code> is 
     * thrown.  An <code>ArrayIndexOutOfBoundsException</code> is
     * thrown if <code>inData</code> is not large enough to hold a pixel
     * value for this <code>ColorModel</code>.  Since
     * <code>DirectColorModel</code> can be subclassed, subclasses inherit
     * the implementation of this method and if they don't override it
     * then they throw an exception if they use an unsupported
     * <code>transferType</code>.
     * If this <code>transferType</code> is not supported, an
     * <code>UnsupportedOperationException</code> is thrown.
     * @param inData the specified pixel
     * @return the alpha component of the specified pixel, scaled from
     *         0 to 255.
     * @exception <code>ClassCastException</code> if <code>inData</code>
     *  is not a primitive array of type <code>transferType</code>
     * @exception <code>ArrayIndexOutOfBoundsException</code> if
     * <code>inData</code> is not large enough to hold a pixel value
     * for this <code>ColorModel</code>
     * @exception <code>UnsupportedOperationException</code> if this
     * <code>tranferType</code> is not supported by this
     * <code>ColorModel</code>
     */
public int getAlpha(Object inData) {
    int pixel = 0;
    switch(transferType) {
        case DataBuffer.TYPE_BYTE:
            byte bdata[] = (byte[]) inData;
            pixel = bdata[0] & 0xff;
            break;
        case DataBuffer.TYPE_USHORT:
            short sdata[] = (short[]) inData;
            pixel = sdata[0] & 0xffff;
            break;
        case DataBuffer.TYPE_INT:
            int idata[] = (int[]) inData;
            pixel = idata[0];
            break;
        default:
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
    }
    return getAlpha(pixel);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.DirectColorModel.getBlue(Object)

/**
     * Returns the blue color component for the specified pixel, scaled
     * from 0 to 255 in the default RGB <code>ColorSpace</code>, sRGB.  A 
     * color conversion is done if necessary.  The pixel value is specified
     * by an array of data elements of type <code>transferType</code> passed 
     * in as an object reference.
     * The returned value is a non pre-multiplied value.  Thus, if the
     * alpha is premultiplied, this method divides it out before returning
     * the value.  If the alpha value is 0, for example, the blue value 
     * is 0.  If <code>inData</code> is not a primitive array of type
     * <code>transferType</code>, a <code>ClassCastException</code> is thrown.
     *  An <code>ArrayIndexOutOfBoundsException</code> is
     * thrown if <code>inData</code> is not large enough to hold a pixel
     * value for this <code>ColorModel</code>.  Since
     * <code>DirectColorModel</code> can be subclassed, subclasses inherit
     * the implementation of this method and if they don't override it
     * then they throw an exception if they use an unsupported
     * <code>transferType</code>.
     * An <code>UnsupportedOperationException</code> is
     * thrown if this <code>transferType</code> is not supported by this 
     * <code>ColorModel</code>.
     * @param inData the array containing the pixel value
     * @return the value of the blue component of the specified pixel.
     * @throws ArrayIndexOutOfBoundsException if <code>inData</code> is not
     *         large enough to hold a pixel value for this color model
     * @throws ClassCastException if <code>inData</code> is not a 
     *         primitive array of type <code>transferType</code>
     * @throws UnsupportedOperationException if this <code>transferType</code>
     *         is not supported by this color model
     */
public int getBlue(Object inData) {
    int pixel = 0;
    switch(transferType) {
        case DataBuffer.TYPE_BYTE:
            byte bdata[] = (byte[]) inData;
            pixel = bdata[0] & 0xff;
            break;
        case DataBuffer.TYPE_USHORT:
            short sdata[] = (short[]) inData;
            pixel = sdata[0] & 0xffff;
            break;
        case DataBuffer.TYPE_INT:
            int idata[] = (int[]) inData;
            pixel = idata[0];
            break;
        default:
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
    }
    return getBlue(pixel);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.DirectColorModel.getComponents(Object, int[], int)

/**
     * Returns an array of unnormalized color/alpha components given a pixel
     * in this <code>ColorModel</code>.  The pixel value is specified by an 
     * array of data elements of type <code>transferType</code> passed in as 
     * an object reference.  If <code>pixel</code> is not a primitive array
     * of type <code>transferType</code>, a <code>ClassCastException</code>
     * is thrown.  An <code>ArrayIndexOutOfBoundsException</code> is
     * thrown if <code>pixel</code> is not large enough to hold a
     * pixel value for this <code>ColorModel</code>.  If the 
     * <code>components</code> array is <code>null</code>, a new
     * array is allocated.  The <code>components</code> array is returned.
     * Color/alpha components are stored in the <code>components</code> array 
     * starting at <code>offset</code>, even if the array is allocated by 
     * this method.  An <code>ArrayIndexOutOfBoundsException</code>
     * is thrown if the <code>components</code> array is not 
     * <code>null</code> and is not large enough to hold all the color and 
     * alpha components, starting at <code>offset</code>.
     * Since <code>DirectColorModel</code> can be subclassed, subclasses
     * inherit the implementation of this method and if they don't
     * override it then they throw an exception if they use an unsupported
     * <code>transferType</code>.
     * @param pixel the specified pixel
     * @param components the array to receive the color and alpha
     *        components of the specified pixel
     * @param offset the offset into the <code>components</code> array at
     *        which to start storing the color and alpha components
     * @return an array containing the color and alpha components of the
     * specified pixel starting at the specified offset.
     * @exception ClassCastException if <code>pixel</code> 
     *  is not a primitive array of type <code>transferType</code>
     * @exception ArrayIndexOutOfBoundsException if
     *  <code>pixel</code> is not large enough to hold a pixel value
     *  for this <code>ColorModel</code>, or if <code>components</code>
     *  is not <code>null</code> and is not large enough to hold all the
     *  color and alpha components, starting at <code>offset</code>
     * @exception UnsupportedOperationException if this
     *            <code>transferType</code> is not supported by this
     *            color model 
     */
public final int[] getComponents(Object pixel, int[] components, int offset) {
    int intpixel = 0;
    switch(transferType) {
        case DataBuffer.TYPE_BYTE:
            byte bdata[] = (byte[]) pixel;
            intpixel = bdata[0] & 0xff;
            break;
        case DataBuffer.TYPE_USHORT:
            short sdata[] = (short[]) pixel;
            intpixel = sdata[0] & 0xffff;
            break;
        case DataBuffer.TYPE_INT:
            int idata[] = (int[]) pixel;
            intpixel = idata[0];
            break;
        default:
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
    }
    return getComponents(intpixel, components, offset);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.DirectColorModel.getDataElements(int, Object)

/**
     * Returns a data element array representation of a pixel in this
     * <code>ColorModel</code>, given an integer pixel representation in the
     * default RGB color model.
     * This array can then be passed to the <code>setDataElements</code>
     * method of a <code>WritableRaster</code> object.  If the pixel variable
     * is <code>null</code>, a new array is allocated.  If <code>pixel</code>
     * is not <code>null</code>, it must be a primitive array of type
     * <code>transferType</code>; otherwise, a
     * <code>ClassCastException</code> is thrown.  An 
     * <code>ArrayIndexOutOfBoundsException</code> is
     * thrown if <code>pixel</code> is not large enough to hold a pixel 
     * value for this <code>ColorModel</code>.  The pixel array is returned.
     * Since <code>DirectColorModel</code> can be subclassed, subclasses
     * inherit the implementation of this method and if they don't
     * override it then they throw an exception if they use an unsupported
     * <code>transferType</code>.
     * @param rgb the integer pixel representation in the default RGB
     *            color model
     * @param pixel the specified pixel
     * @return an array representation of the specified pixel in this
     *         <code>ColorModel</code>
     * @exception ClassCastException if <code>pixel</code> 
     *  is not a primitive array of type <code>transferType</code>
     * @exception ArrayIndexOutOfBoundsException if
     *  <code>pixel</code> is not large enough to hold a pixel value
     *  for this <code>ColorModel</code>
     * @exception UnsupportedOperationException if this
     *  <code>transferType</code> is not supported by this 
     *  <code>ColorModel</code> 
     * @see WritableRaster#setDataElements
     * @see SampleModel#setDataElements
     */
public Object getDataElements(int rgb, Object pixel) {
    int intpixel[] = null;
    if (transferType == DataBuffer.TYPE_INT && pixel != null) {
        intpixel = (int[]) pixel;
        intpixel[0] = 0;
    } else {
        intpixel = new int[1];
    }
    ColorModel defaultCM = ColorModel.getRGBdefault();
    if (this == defaultCM || equals(defaultCM)) {
        intpixel[0] = rgb;
        return intpixel;
    }
    int red, grn, blu, alp;
    red = (rgb >> 16) & 0xff;
    grn = (rgb >> 8) & 0xff;
    blu = rgb & 0xff;
    if (is_sRGB || is_LinearRGB) {
        int precision;
        float factor;
        if (is_LinearRGB) {
            if (lRGBprecision == 8) {
                red = fromsRGB8LUT8[red] & 0xff;
                grn = fromsRGB8LUT8[grn] & 0xff;
                blu = fromsRGB8LUT8[blu] & 0xff;
                precision = 8;
                factor = 1.0f / 255.0f;
            } else {
                red = fromsRGB8LUT16[red] & 0xffff;
                grn = fromsRGB8LUT16[grn] & 0xffff;
                blu = fromsRGB8LUT16[blu] & 0xffff;
                precision = 16;
                factor = 1.0f / 65535.0f;
            }
        } else {
            precision = 8;
            factor = 1.0f / 255.0f;
        }
        if (supportsAlpha) {
            alp = (rgb >> 24) & 0xff;
            if (isAlphaPremultiplied) {
                factor *= (alp * (1.0f / 255.0f));
                precision = -1;
            }
            if (nBits[3] != 8) {
                alp = (int) ((alp * (1.0f / 255.0f) * ((1 << nBits[3]) - 1)) + 0.5f);
                if (alp > ((1 << nBits[3]) - 1)) {
                    alp = (1 << nBits[3]) - 1;
                }
            }
            intpixel[0] = alp << maskOffsets[3];
        }
        if (nBits[0] != precision) {
            red = (int) ((red * factor * ((1 << nBits[0]) - 1)) + 0.5f);
        }
        if (nBits[1] != precision) {
            grn = (int) ((grn * factor * ((1 << nBits[1]) - 1)) + 0.5f);
        }
        if (nBits[2] != precision) {
            blu = (int) ((blu * factor * ((1 << nBits[2]) - 1)) + 0.5f);
        }
    } else {
        float[] norm = new float[3];
        float factor = 1.0f / 255.0f;
        norm[0] = red * factor;
        norm[1] = grn * factor;
        norm[2] = blu * factor;
        norm = colorSpace.fromRGB(norm);
        if (supportsAlpha) {
            alp = (rgb >> 24) & 0xff;
            if (isAlphaPremultiplied) {
                factor *= alp;
                for (int i = 0; i < 3; i++) {
                    norm[i] *= factor;
                }
            }
            if (nBits[3] != 8) {
                alp = (int) ((alp * (1.0f / 255.0f) * ((1 << nBits[3]) - 1)) + 0.5f);
                if (alp > ((1 << nBits[3]) - 1)) {
                    alp = (1 << nBits[3]) - 1;
                }
            }
            intpixel[0] = alp << maskOffsets[3];
        }
        red = (int) ((norm[0] * ((1 << nBits[0]) - 1)) + 0.5f);
        grn = (int) ((norm[1] * ((1 << nBits[1]) - 1)) + 0.5f);
        blu = (int) ((norm[2] * ((1 << nBits[2]) - 1)) + 0.5f);
    }
    if (maxBits > 23) {
        if (red > ((1 << nBits[0]) - 1)) {
            red = (1 << nBits[0]) - 1;
        }
        if (grn > ((1 << nBits[1]) - 1)) {
            grn = (1 << nBits[1]) - 1;
        }
        if (blu > ((1 << nBits[2]) - 1)) {
            blu = (1 << nBits[2]) - 1;
        }
    }
    intpixel[0] |= (red << maskOffsets[0]) | (grn << maskOffsets[1]) | (blu << maskOffsets[2]);
    switch(transferType) {
        case DataBuffer.TYPE_BYTE:
            {
                byte bdata[];
                if (pixel == null) {
                    bdata = new byte[1];
                } else {
                    bdata = (byte[]) pixel;
                }
                bdata[0] = (byte) (0xff & intpixel[0]);
                return bdata;
            }
        case DataBuffer.TYPE_USHORT:
            {
                short sdata[];
                if (pixel == null) {
                    sdata = new short[1];
                } else {
                    sdata = (short[]) pixel;
                }
                sdata[0] = (short) (intpixel[0] & 0xffff);
                return sdata;
            }
        case DataBuffer.TYPE_INT:
            return intpixel;
    }
    throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.DirectColorModel.getGreen(Object)

/**
     * Returns the green color component for the specified pixel, scaled
     * from 0 to 255 in the default RGB <code>ColorSpace</code>, sRGB.  A 
     * color conversion is done if necessary.  The pixel value is specified
     * by an array of data elements of type <code>transferType</code> passed 
     * in as an object reference.
     * The returned value is a non pre-multiplied value.  Thus, if the
     * alpha is premultiplied, this method divides it out before returning
     * the value.  If the alpha value is 0, for example, the green value 
     * is 0.  If <code>inData</code> is not a primitive array of type
     * <code>transferType</code>, a <code>ClassCastException</code> is thrown.
     *  An <code>ArrayIndexOutOfBoundsException</code> is
     * thrown if <code>inData</code> is not large enough to hold a pixel
     * value for this <code>ColorModel</code>.  Since
     * <code>DirectColorModel</code> can be subclassed, subclasses inherit
     * the implementation of this method and if they don't override it
     * then they throw an exception if they use an unsupported
     * <code>transferType</code>.
     * An <code>UnsupportedOperationException</code> is
     * thrown if this <code>transferType</code> is not supported by this 
     * <code>ColorModel</code>.
     * @param inData the array containing the pixel value
     * @return the value of the green component of the specified pixel.
     * @throws ArrayIndexOutOfBoundsException if <code>inData</code> is not
     *         large enough to hold a pixel value for this color model
     * @throws ClassCastException if <code>inData</code> is not a 
     *         primitive array of type <code>transferType</code>
     * @throws UnsupportedOperationException if this <code>transferType</code>
     *         is not supported by this color model
     */
public int getGreen(Object inData) {
    int pixel = 0;
    switch(transferType) {
        case DataBuffer.TYPE_BYTE:
            byte bdata[] = (byte[]) inData;
            pixel = bdata[0] & 0xff;
            break;
        case DataBuffer.TYPE_USHORT:
            short sdata[] = (short[]) inData;
            pixel = sdata[0] & 0xffff;
            break;
        case DataBuffer.TYPE_INT:
            int idata[] = (int[]) inData;
            pixel = idata[0];
            break;
        default:
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
    }
    return getGreen(pixel);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.DirectColorModel.getRGB(Object)

/**
     * Returns the color/alpha components for the specified pixel in the
     * default RGB color model format.  A color conversion is done if
     * necessary.  The pixel value is specified by an array of data
     * elements of type <code>transferType</code> passed in as an object
     * reference.  If <code>inData</code> is not a primitive array of type
     * <code>transferType</code>, a <code>ClassCastException</code> is 
     * thrown.  An <code>ArrayIndexOutOfBoundsException</code> is
     * thrown if <code>inData</code> is not large enough to hold a pixel
     * value for this <code>ColorModel</code>.
     * The returned value is in a non pre-multiplied format.  Thus, if
     * the alpha is premultiplied, this method divides it out of the
     * color components.  If the alpha value is 0, for example, the color 
     * values is 0.  Since <code>DirectColorModel</code> can be
     * subclassed, subclasses inherit the implementation of this method
     * and if they don't override it then
     * they throw an exception if they use an unsupported 
     * <code>transferType</code>.
     * @param inData the specified pixel
     * @return the color and alpha components of the specified pixel.
     * @exception UnsupportedOperationException if this 
     *            <code>transferType</code> is not supported by this
     *            <code>ColorModel</code>
     * @see ColorModel#getRGBdefault
     */
public int getRGB(Object inData) {
    int pixel = 0;
    switch(transferType) {
        case DataBuffer.TYPE_BYTE:
            byte bdata[] = (byte[]) inData;
            pixel = bdata[0] & 0xff;
            break;
        case DataBuffer.TYPE_USHORT:
            short sdata[] = (short[]) inData;
            pixel = sdata[0] & 0xffff;
            break;
        case DataBuffer.TYPE_INT:
            int idata[] = (int[]) inData;
            pixel = idata[0];
            break;
        default:
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
    }
    return getRGB(pixel);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.DirectColorModel.getRed(Object)

/**
     * Returns the red color component for the specified pixel, scaled
     * from 0 to 255 in the default RGB <code>ColorSpace</code>, sRGB.  A 
     * color conversion is done if necessary.  The pixel value is specified
     * by an array of data elements of type <code>transferType</code> passed 
     * in as an object reference.
     * The returned value is a non pre-multiplied value.  Thus, if the
     * alpha is premultiplied, this method divides it out before returning
     * the value.  If the alpha value is 0, for example, the red value 
     * is 0.
     * If <code>inData</code> is not a primitive array of type 
     * <code>transferType</code>, a <code>ClassCastException</code> is 
     * thrown.  An <code>ArrayIndexOutOfBoundsException</code> is
     * thrown if <code>inData</code> is not large enough to hold a
     * pixel value for this <code>ColorModel</code>.  Since
     * <code>DirectColorModel</code> can be subclassed, subclasses inherit
     * the implementation of this method and if they don't override it
     * then they throw an exception if they use an unsupported
     * <code>transferType</code>.
     * An <code>UnsupportedOperationException</code> is thrown if this
     * <code>transferType</code> is not supported by this 
     * <code>ColorModel</code>.
     * @param inData the array containing the pixel value
     * @return the value of the red component of the specified pixel.
     * @throws ArrayIndexOutOfBoundsException if <code>inData</code> is not
     *         large enough to hold a pixel value for this color model
     * @throws ClassCastException if <code>inData</code> is not a 
     *         primitive array of type <code>transferType</code>
     * @throws UnsupportedOperationException if this <code>transferType</code>
     *         is not supported by this color model
     */
public int getRed(Object inData) {
    int pixel = 0;
    switch(transferType) {
        case DataBuffer.TYPE_BYTE:
            byte bdata[] = (byte[]) inData;
            pixel = bdata[0] & 0xff;
            break;
        case DataBuffer.TYPE_USHORT:
            short sdata[] = (short[]) inData;
            pixel = sdata[0] & 0xffff;
            break;
        case DataBuffer.TYPE_INT:
            int idata[] = (int[]) inData;
            pixel = idata[0];
            break;
        default:
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
    }
    return getRed(pixel);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.IndexColorModel.getComponents(Object, int[], int)

/**
     * Returns an array of unnormalized color/alpha components for
     * a specified pixel in this <code>ColorModel</code>.  The pixel 
     * value is specified by an array of data elements of type 
     * <code>transferType</code> passed in as an object reference.
     * If <code>pixel</code> is not a primitive array of type 
     * <code>transferType</code>, a <code>ClassCastException</code>
     * is thrown.  An <code>ArrayIndexOutOfBoundsException</code>
     * is thrown if <code>pixel</code> is not large enough to hold 
     * a pixel value for this <code>ColorModel</code>.  If the 
     * <code>components</code> array is <code>null</code>, a new array 
     * is allocated that contains 
     * <code>offset + getNumComponents()</code> elements. 
     * The <code>components</code> array is returned, 
     * with the alpha component included 
     * only if <code>hasAlpha</code> returns true.  
     * Color/alpha components are stored in the <code>components</code> 
     * array starting at <code>offset</code> even if the array is
     * allocated by this method.  An 
     * <code>ArrayIndexOutOfBoundsException</code> is also
     * thrown if  the <code>components</code> array is not 
     * <code>null</code> and is not large enough to hold all the color 
     * and alpha components starting at <code>offset</code>.  
     * Since <code>IndexColorModel</code> can be subclassed, subclasses 
     * inherit the implementation of this method and if they don't
     * override it then they throw an exception if they use an 
     * unsupported <code>transferType</code>.
     * @param pixel the specified pixel
     * @param components an array that receives the color and alpha  
     * components of the specified pixel
     * @param offset the index into the <code>components</code> array at
     * which to begin storing the color and alpha components of the
     * specified pixel
     * @return an array containing the color and alpha components of the
     * specified pixel starting at the specified offset.
     * @throws ArrayIndexOutOfBoundsException if <code>pixel</code>
     *            is not large enough to hold a pixel value for this
     *            <code>ColorModel</code> or if the 
     *            <code>components</code> array is not <code>null</code> 
     *            and is not large enough to hold all the color 
     *            and alpha components starting at <code>offset</code>
     * @throws ClassCastException if <code>pixel</code> is not a 
     *            primitive array of type <code>transferType</code>
     * @throws UnsupportedOperationException if <code>transferType</code>
     *         is not one of the supported transer types
     * @see ColorModel#hasAlpha
     * @see ColorModel#getNumComponents
     */
public int[] getComponents(Object pixel, int[] components, int offset) {
    int intpixel;
    switch(transferType) {
        case DataBuffer.TYPE_BYTE:
            byte bdata[] = (byte[]) pixel;
            intpixel = bdata[0] & 0xff;
            break;
        case DataBuffer.TYPE_USHORT:
            short sdata[] = (short[]) pixel;
            intpixel = sdata[0] & 0xffff;
            break;
        case DataBuffer.TYPE_INT:
            int idata[] = (int[]) pixel;
            intpixel = idata[0];
            break;
        default:
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
    }
    return getComponents(intpixel, components, offset);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.IndexColorModel.getDataElement(int[], int)

/**
     * Returns a pixel value represented as an int in this 
     * <code>ColorModel</code> given an array of unnormalized 
     * color/alpha components.  An 
     * <code>ArrayIndexOutOfBoundsException</code> 
     * is thrown if the <code>components</code> array is not large 
     * enough to hold all of the color and alpha components starting
     * at <code>offset</code>.  Since
     * <code>ColorModel</code> can be subclassed, subclasses inherit the
     * implementation of this method and if they don't override it then
     * they throw an exception if they use an unsupported transferType.
     * @param components an array of unnormalized color and alpha
     * components
     * @param offset the index into <code>components</code> at which to
     * begin retrieving the color and alpha components
     * @return an <code>int</code> pixel value in this
     * <code>ColorModel</code> corresponding to the specified components.
     * @throws ArrayIndexOutOfBoundsException if
     *  the <code>components</code> array is not large enough to
     *  hold all of the color and alpha components starting at
     *  <code>offset</code>
     * @throws UnsupportedOperationException if <code>transferType</code>
     *         is invalid
     */
public int getDataElement(int[] components, int offset) {
    int rgb = (components[offset + 0] << 16) | (components[offset + 1] << 8) | (components[offset + 2]);
    if (supportsAlpha) {
        rgb |= (components[offset + 3] << 24);
    } else {
        rgb |= 0xff000000;
    }
    Object inData = getDataElements(rgb, null);
    int pixel;
    switch(transferType) {
        case DataBuffer.TYPE_BYTE:
            byte bdata[] = (byte[]) inData;
            pixel = bdata[0] & 0xff;
            break;
        case DataBuffer.TYPE_USHORT:
            short sdata[] = (short[]) inData;
            pixel = sdata[0];
            break;
        case DataBuffer.TYPE_INT:
            int idata[] = (int[]) inData;
            pixel = idata[0];
            break;
        default:
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
    }
    return pixel;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.IndexColorModel.installpixel(Object, int)

private Object installpixel(Object pixel, int pix) {
    switch(transferType) {
        case DataBuffer.TYPE_INT:
            int[] intObj;
            if (pixel == null) {
                pixel = intObj = new int[1];
            } else {
                intObj = (int[]) pixel;
            }
            intObj[0] = pix;
            break;
        case DataBuffer.TYPE_BYTE:
            byte[] byteObj;
            if (pixel == null) {
                pixel = byteObj = new byte[1];
            } else {
                byteObj = (byte[]) pixel;
            }
            byteObj[0] = (byte) pix;
            break;
        case DataBuffer.TYPE_USHORT:
            short[] shortObj;
            if (pixel == null) {
                pixel = shortObj = new short[1];
            } else {
                shortObj = (short[]) pixel;
            }
            shortObj[0] = (short) pix;
            break;
        default:
            throw new UnsupportedOperationException('This method has not been ' + 'implemented for transferType ' + transferType);
    }
    return pixel;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ColorModel.getDataElements(int[], int, Object)

/**
     * Returns a data element array representation of a pixel in this
     * <code>ColorModel</code>, given an array of unnormalized color/alpha
     * components.  This array can then be passed to the
     * <code>setDataElements</code> method of a <code>WritableRaster</code> 
     * object.  This method will throw an <code>IllegalArgumentException</code>
     * if color component values for this <code>ColorModel</code> are not
     * conveniently representable in the unnormalized form.
     * An <code>ArrayIndexOutOfBoundsException</code> is thrown
     * if the <code>components</code> array is not large enough to hold
     * all the color and alpha components (starting at
     * <code>offset</code>).  If the <code>obj</code> variable is
     * <code>null</code>, a new array will be allocated.  If
     * <code>obj</code> is not <code>null</code>, it must be a primitive
     * array of type transferType; otherwise, a 
     * <code>ClassCastException</code> is thrown.  An
     * <code>ArrayIndexOutOfBoundsException</code> is thrown if 
     * <code>obj</code> is not large enough to hold a pixel value for this
     * <code>ColorModel</code>.
     * Since <code>ColorModel</code> is an abstract class,
     * any instance is an instance of a subclass.  Subclasses must
     * override this method since the implementation in this abstract
     * class throws an <code>UnsupportedOperationException</code>.
     * @param components an array of unnormalized color and alpha
     * components
     * @param offset the index into <code>components</code> at which to
     * begin retrieving color and alpha components
     * @param obj the <code>Object</code> representing an array of color
     * and alpha components
     * @return an <code>Object</code> representing an array of color and
     * alpha components.
     * @throws ClassCastException if <code>obj</code>
     *  is not a primitive array of type <code>transferType</code>
     * @throws ArrayIndexOutOfBoundsException if
     *  <code>obj</code> is not large enough to hold a pixel value
     *  for this <code>ColorModel</code> or the <code>components</code>
     * array is not large enough to hold all of the color and alpha
     * components starting at <code>offset</code> 
     * @throws IllegalArgumentException if
     *  component values for this <code>ColorModel</code> are not 
     *  conveniently representable in the unnormalized form
     * @throws UnsupportedOperationException if this 
     *  method is not supported by this <code>ColorModel</code> 
     * @see WritableRaster#setDataElements
     * @see SampleModel#setDataElements
     */
public Object getDataElements(int[] components, int offset, Object obj) {
    throw new UnsupportedOperationException('This method has not been implemented ' + 'for this color model.');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ColorModel.isCompatibleRaster(Raster)

/**
      * Returns <code>true</code> if <code>raster</code> is compatible
      * with this <code>ColorModel</code> and <code>false</code> if it is
      * not.
      * Since <code>ColorModel</code> is an abstract class,
      * any instance is an instance of a subclass.  Subclasses must
      * override this method since the implementation in this abstract
      * class throws an <code>UnsupportedOperationException</code>.
      * @param raster the {@link Raster} object to test for compatibility
      * @return <code>true</code> if <code>raster</code> is compatible
      * with this <code>ColorModel</code>.
      * @throws UnsupportedOperationException if this
      *  method has not been implemented for this 
      *  <code>ColorModel</code>
      */
public boolean isCompatibleRaster(Raster raster) {
    throw new UnsupportedOperationException('This method has not been implemented for this ColorModel.');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.IndexColorModel.createCompatibleWritableRaster(int, int)

/**
     * Creates a <code>WritableRaster</code> with the specified width 
     * and height that has a data layout (<code>SampleModel</code>) 
     * compatible with this <code>ColorModel</code>.  This method
     * only works for color models with 16 or fewer bits per pixel.
     * Since <code>IndexColorModel</code> can be subclassed, any 
     * subclass that supports greater than 16 bits per pixel must
     * override this method.
     * @param w the width to apply to the new <code>WritableRaster</code>
     * @param h the height to apply to the new <code>WritableRaster</code>
     * @return a <code>WritableRaster</code> object with the specified
     * width and height.
     * @throws UnsupportedOperationException if the number of bits in a
     *         pixel is greater than 16
     * @see WritableRaster
     * @see SampleModel
     */
public WritableRaster createCompatibleWritableRaster(int w, int h) {
    WritableRaster raster;
    if (pixel_bits == 1 || pixel_bits == 2 || pixel_bits == 4) {
        raster = Raster.createPackedRaster(DataBuffer.TYPE_BYTE, w, h, 1, pixel_bits, null);
    } else if (pixel_bits <= 8) {
        raster = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE, w, h, 1, null);
    } else if (pixel_bits <= 16) {
        raster = Raster.createInterleavedRaster(DataBuffer.TYPE_USHORT, w, h, 1, null);
    } else {
        throw new UnsupportedOperationException('This method is not supported ' + ' for pixel bits > 16.');
    }
    return raster;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ColorModel.getDataElement(int[], int)

/**
     * Returns a pixel value represented as an <code>int</code> in this
     * <code>ColorModel</code>, given an array of unnormalized color/alpha
     * components.  This method will throw an 
     * <code>IllegalArgumentException</code> if component values for this
     * <code>ColorModel</code> are not conveniently representable as a
     * single <code>int</code> or if color component values for this
     * <code>ColorModel</code> are not conveniently representable in the
     * unnormalized form.  An 
     * <code>ArrayIndexOutOfBoundsException</code> is thrown if  the
     * <code>components</code> array is not large enough to hold all the
     * color and alpha components (starting at <code>offset</code>).
     * Since <code>ColorModel</code> is an abstract class,
     * any instance is an instance of a subclass.  Subclasses must
     * override this method since the implementation in this abstract
     * class throws an <code>UnsupportedOperationException</code>.
     * @param components an array of unnormalized color and alpha
     * components
     * @param offset the index into <code>components</code> at which to
     * begin retrieving the color and alpha components
     * @return an <code>int</code> pixel value in this
     * <code>ColorModel</code> corresponding to the specified components.  
     * @throws IllegalArgumentException if
     *  pixel values for this <code>ColorModel</code> are not 
     *  conveniently representable as a single <code>int</code>
     * @throws IllegalArgumentException if
     *  component values for this <code>ColorModel</code> are not 
     *  conveniently representable in the unnormalized form
     * @throws ArrayIndexOutOfBoundsException if
     *  the <code>components</code> array is not large enough to 
     * hold all of the color and alpha components starting at
     * <code>offset</code> 
     * @throws UnsupportedOperationException if this
     *  method is not supported by this <code>ColorModel</code>
     */
public int getDataElement(int[] components, int offset) {
    throw new UnsupportedOperationException('This method is not supported ' + 'by this color model.');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ColorModel.getUnnormalizedComponents(float[], int, int[], int)

/**
     * Returns an array of all of the color/alpha components in unnormalized
     * form, given a normalized component array.  Unnormalized components
     * are unsigned integral values between 0 and 2<sup>n</sup> - 1, where
     * n is the number of bits for a particular component.  Normalized
     * components are float values between a per component minimum and
     * maximum specified by the <code>ColorSpace</code> object for this
     * <code>ColorModel</code>.  An <code>IllegalArgumentException</code>
     * will be thrown if color component values for this
     * <code>ColorModel</code> are not conveniently representable in the
     * unnormalized form.  If the 
     * <code>components</code> array is <code>null</code>, a new array
     * will be allocated.  The <code>components</code> array will
     * be returned.  Color/alpha components are stored in the 
     * <code>components</code> array starting at <code>offset</code> (even
     * if the array is allocated by this method). An
     * <code>ArrayIndexOutOfBoundsException</code> is thrown if the
     * <code>components</code> array is not <code>null</code> and is not
     * large enough to hold all the color and alpha
     * components (starting at <code>offset</code>).  An
     * <code>IllegalArgumentException</code> is thrown if the
     * <code>normComponents</code> array is not large enough to hold
     * all the color and alpha components starting at
     * <code>normOffset</code>.
     * @param normComponents an array containing normalized components
     * @param normOffset the offset into the <code>normComponents</code> 
     * array at which to start retrieving normalized components
     * @param components an array that receives the components from
     * <code>normComponents</code>
     * @param offset the index into <code>components</code> at which to
     * begin storing normalized components from 
     * <code>normComponents</code>
     * @return an array containing unnormalized color and alpha 
     * components.
     * @throws IllegalArgumentException If the component values for this
     * <CODE>ColorModel</CODE> are not conveniently representable in the
     * unnormalized form.
     * @throws IllegalArgumentException if the length of 
     *          <code>normComponents</code> minus <code>normOffset</code>
     *          is less than <code>numComponents</code>
     * @throws UnsupportedOperationException if the
     *          constructor of this <code>ColorModel</code> called the
     *          <code>super(bits)</code> constructor, but did not 
     *          override this method.  See the constructor, 
     *          {@link #ColorModel(int)}.
     */
public int[] getUnnormalizedComponents(float[] normComponents, int normOffset, int[] components, int offset) {
    if (colorSpace == null) {
        throw new UnsupportedOperationException('This method is not supported ' + 'by this color model.');
    }
    if (nBits == null) {
        throw new UnsupportedOperationException('This method is not supported.  ' + 'Unable to determine #bits per ' + 'component.');
    }
    if ((normComponents.length - normOffset) < numComponents) {
        throw new IllegalArgumentException('Incorrect number of components.  Expecting ' + numComponents);
    }
    if (components == null) {
        components = new int[offset + numComponents];
    }
    if (supportsAlpha && isAlphaPremultiplied) {
        float normAlpha = normComponents[normOffset + numColorComponents];
        for (int i = 0; i < numColorComponents; i++) {
            components[offset + i] = (int) (normComponents[normOffset + i] * ((1 << nBits[i]) - 1) * normAlpha + 0.5f);
        }
        components[offset + numColorComponents] = (int) (normAlpha * ((1 << nBits[numColorComponents]) - 1) + 0.5f);
    } else {
        for (int i = 0; i < numComponents; i++) {
            components[offset + i] = (int) (normComponents[normOffset + i] * ((1 << nBits[i]) - 1) + 0.5f);
        }
    }
    return components;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ColorModel.getNormalizedComponents(int[], int, float[], int)

/**
     * Returns an array of all of the color/alpha components in normalized
     * form, given an unnormalized component array.  Unnormalized components
     * are unsigned integral values between 0 and 2<sup>n</sup> - 1, where
     * n is the number of bits for a particular component.  Normalized
     * components are float values between a per component minimum and
     * maximum specified by the <code>ColorSpace</code> object for this
     * <code>ColorModel</code>.  An <code>IllegalArgumentException</code>
     * will be thrown if color component values for this
     * <code>ColorModel</code> are not conveniently representable in the
     * unnormalized form.  If the
     * <code>normComponents</code> array is <code>null</code>, a new array
     * will be allocated.  The <code>normComponents</code> array
     * will be returned.  Color/alpha components are stored in the
     * <code>normComponents</code> array starting at
     * <code>normOffset</code> (even if the array is allocated by this
     * method).  An <code>ArrayIndexOutOfBoundsException</code> is thrown
     * if the <code>normComponents</code> array is not <code>null</code> 
     * and is not large enough to hold all the color and alpha components
     * (starting at <code>normOffset</code>).  An
     * <code>IllegalArgumentException</code> is thrown if the 
     * <code>components</code> array is not large enough to hold all the
     * color and alpha components starting at <code>offset</code>.
     * Since <code>ColorModel</code> is an abstract class,
     * any instance is an instance of a subclass.  The default implementation
     * of this method in this abstract class assumes that component values
     * for this class are conveniently representable in the unnormalized
     * form.  Therefore, subclasses which may
     * have instances which do not support the unnormalized form must
     * override this method.
     * @param components an array containing unnormalized components
     * @param offset the offset into the <code>components</code> array at
     * which to start retrieving unnormalized components
     * @param normComponents an array that receives the normalized components
     * @param normOffset the index into <code>normComponents</code> at
     * which to begin storing normalized components
     * @return an array containing normalized color and alpha 
     * components. 
     * @throws IllegalArgumentException If the component values for this
     * <CODE>ColorModel</CODE> are not conveniently representable in the
     * unnormalized form.
     * @throws UnsupportedOperationException if the
     *          constructor of this <code>ColorModel</code> called the
     *          <code>super(bits)</code> constructor, but did not
     *          override this method.  See the constructor,
     *          {@link #ColorModel(int)}.
     * @throws UnsupportedOperationException if this method is unable
     *          to determine the number of bits per component
     */
public float[] getNormalizedComponents(int[] components, int offset, float[] normComponents, int normOffset) {
    if (colorSpace == null) {
        throw new UnsupportedOperationException('This method is not supported by ' + 'this color model.');
    }
    if (nBits == null) {
        throw new UnsupportedOperationException('This method is not supported.  ' + 'Unable to determine #bits per ' + 'component.');
    }
    if ((components.length - offset) < numComponents) {
        throw new IllegalArgumentException('Incorrect number of components.  Expecting ' + numComponents);
    }
    if (normComponents == null) {
        normComponents = new float[numComponents + normOffset];
    }
    if (supportsAlpha && isAlphaPremultiplied) {
        float normAlpha = (float) components[offset + numColorComponents];
        normAlpha /= (float) ((1 << nBits[numColorComponents]) - 1);
        if (normAlpha != 0.0f) {
            for (int i = 0; i < numColorComponents; i++) {
                normComponents[normOffset + i] = ((float) components[offset + i]) / (normAlpha * ((float) ((1 << nBits[i]) - 1)));
            }
        } else {
            for (int i = 0; i < numColorComponents; i++) {
                normComponents[normOffset + i] = 0.0f;
            }
        }
        normComponents[normOffset + numColorComponents] = normAlpha;
    } else {
        for (int i = 0; i < numComponents; i++) {
            normComponents[normOffset + i] = ((float) components[offset + i]) / ((float) ((1 << nBits[i]) - 1));
        }
    }
    return normComponents;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ColorModel.coerceData(WritableRaster, boolean)

/**
     * Forces the raster data to match the state specified in the
     * <code>isAlphaPremultiplied</code> variable, assuming the data is
     * currently correctly described by this <code>ColorModel</code>.  It
     * may multiply or divide the color raster data by alpha, or do
     * nothing if the data is in the correct state.  If the data needs to
     * be coerced, this method will also return an instance of this
     * <code>ColorModel</code> with the <code>isAlphaPremultiplied</code> 
     * flag set appropriately.  This method will throw a
     * <code>UnsupportedOperationException</code> if it is not supported
     * by this <code>ColorModel</code>.
     * Since <code>ColorModel</code> is an abstract class,
     * any instance is an instance of a subclass.  Subclasses must
     * override this method since the implementation in this abstract
     * class throws an <code>UnsupportedOperationException</code>.
     * @param raster the <code>WritableRaster</code> data
     * @param isAlphaPremultiplied <code>true</code> if the alpha is
     * premultiplied; <code>false</code> otherwise
     * @return a <code>ColorModel</code> object that represents the
     * coerced data.
     */
public ColorModel coerceData(WritableRaster raster, boolean isAlphaPremultiplied) {
    throw new UnsupportedOperationException('This method is not supported by this color model');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ColorModel.createCompatibleSampleModel(int, int)

/**
     * Creates a <code>SampleModel</code> with the specified width and
     * height that has a data layout compatible with this 
     * <code>ColorModel</code>.
     * Since <code>ColorModel</code> is an abstract class,
     * any instance is an instance of a subclass.  Subclasses must
     * override this method since the implementation in this abstract
     * class throws an <code>UnsupportedOperationException</code>.
     * @param w the width to apply to the new <code>SampleModel</code>
     * @param h the height to apply to the new <code>SampleModel</code>
     * @return a <code>SampleModel</code> object with the specified
     * width and height.
     * @throws UnsupportedOperationException if this
     *   method is not supported by this <code>ColorModel</code>  
     * @see SampleModel
     */
public SampleModel createCompatibleSampleModel(int w, int h) {
    throw new UnsupportedOperationException('This method is not supported by this color model');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ColorModel.createCompatibleWritableRaster(int, int)

/**
     * Creates a <code>WritableRaster</code> with the specified width and
     * height that has a data layout (<code>SampleModel</code>) compatible
     * with this <code>ColorModel</code>.
     * Since <code>ColorModel</code> is an abstract class,
     * any instance is an instance of a subclass.  Subclasses must
     * override this method since the implementation in this abstract
     * class throws an <code>UnsupportedOperationException</code>.
     * @param w the width to apply to the new <code>WritableRaster</code>
     * @param h the height to apply to the new <code>WritableRaster</code>
     * @return a <code>WritableRaster</code> object with the specified
     * width and height.  
     * @throws UnsupportedOperationException if this
     *   method is not supported by this <code>ColorModel</code>
     * @see WritableRaster
     * @see SampleModel
     */
public WritableRaster createCompatibleWritableRaster(int w, int h) {
    throw new UnsupportedOperationException('This method is not supported by this color model');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ColorModel.isCompatibleSampleModel(SampleModel)

/** Checks if the <code>SampleModel</code> is compatible with this
     * <code>ColorModel</code>.
     * Since <code>ColorModel</code> is an abstract class,
     * any instance is an instance of a subclass.  Subclasses must
     * override this method since the implementation in this abstract
     * class throws an <code>UnsupportedOperationException</code>.
     * @param sm the specified <code>SampleModel</code>
     * @return <code>true</code> if the specified <code>SampleModel</code>
     * is compatible with this <code>ColorModel</code>; <code>false</code>
     * otherwise.
     * @throws UnsupportedOperationException if this
     *   method is not supported by this <code>ColorModel</code>
     * @see SampleModel 
     */
public boolean isCompatibleSampleModel(SampleModel sm) {
    throw new UnsupportedOperationException('This method is not supported by this color model');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ColorModel.getComponents(Object, int[], int)

/**
     * Returns an array of unnormalized color/alpha components given a pixel
     * in this <code>ColorModel</code>.  The pixel value is specified by
     * an array of data elements of type transferType passed in as an
     * object reference.  If <code>pixel</code> is not a primitive array
     * of type transferType, a <code>ClassCastException</code> is thrown.
     * An <code>IllegalArgumentException</code> will be thrown if color
     * component values for this <code>ColorModel</code> are not
     * conveniently representable in the unnormalized form.
     * An <code>ArrayIndexOutOfBoundsException</code> is
     * thrown if <code>pixel</code> is not large enough to hold a pixel
     * value for this <code>ColorModel</code>.
     * This method can be used to retrieve the components for a specific
     * pixel value in any <code>ColorModel</code>.  If the components
     * array is <code>null</code>, a new array will be allocated.  The
     * components array will be returned.  Color/alpha components are
     * stored in the <code>components</code> array starting at 
     * <code>offset</code> (even if the array is allocated by this
     * method).  An <code>ArrayIndexOutOfBoundsException</code>
     * is thrown if  the components array is not <code>null</code> and is
     * not large enough to hold all the color and alpha components
     * (starting at <code>offset</code>).
     * Since <code>ColorModel</code> is an abstract class,
     * any instance is an instance of a subclass.  Subclasses must   
     * override this method since the implementation in this abstract
     * class throws an <code>UnsupportedOperationException</code>.
     * @param pixel the specified pixel
     * @param components an array that receives the color and alpha
     * components of the specified pixel
     * @param offset the index into the <code>components</code> array at
     * which to begin storing the color and alpha components of the 
     * specified pixel
     * @return an array containing the color and alpha components of the
     * specified pixel starting at the specified offset.
     * @throws UnsupportedOperationException if this
     *  method is not supported by this <code>ColorModel</code>
     */
public int[] getComponents(Object pixel, int[] components, int offset) {
    throw new UnsupportedOperationException('This method is not supported by this color model.');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ColorModel.getComponents(int, int[], int)

/**
     * Returns an array of unnormalized color/alpha components given a pixel 
     * in this <code>ColorModel</code>.  The pixel value is specified as
     * an <code>int</code>.  An <code>IllegalArgumentException</code>
     * will be thrown if pixel values for this <code>ColorModel</code> are
     * not conveniently representable as a single <code>int</code> or if
     * color component values for this <code>ColorModel</code> are not
     * conveniently representable in the unnormalized form.
     * For example, this method can be used to retrieve the
     * components for a specific pixel value in a 
     * <code>DirectColorModel</code>.  If the components array is 
     * <code>null</code>, a new array will be allocated.  The
     * components array will be returned.  Color/alpha components are
     * stored in the components array starting at <code>offset</code> 
     * (even if the array is allocated by this method).  An
     * <code>ArrayIndexOutOfBoundsException</code> is thrown if  the
     * components array is not <code>null</code> and is not large
     * enough to hold all the color and alpha components (starting at offset).
     * Since <code>ColorModel</code> is an abstract class,
     * any instance is an instance of a subclass.  Subclasses must   
     * override this method since the implementation in this abstract
     * class throws an <code>UnsupportedOperationException</code>.
     * @param pixel the specified pixel
     * @param components the array to receive the color and alpha
     * components of the specified pixel
     * @param offset the offset into the <code>components</code> array at
     * which to start storing the color and alpha components
     * @return an array containing the color and alpha components of the
     * specified pixel starting at the specified offset.
     * @throws UnsupportedOperationException if this
     *  method is not supported by this <code>ColorModel</code>
     */
public int[] getComponents(int pixel, int[] components, int offset) {
    throw new UnsupportedOperationException('This method is not supported by this color model.');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ColorModel.getDataElements(int, Object)

/**
     * Returns a data element array representation of a pixel in this
     * <code>ColorModel</code>, given an integer pixel representation in
     * the default RGB color model.
     * This array can then be passed to the 
     * {@link WritableRaster#setDataElements} method of
     * a {@link WritableRaster} object.  If the pixel variable is 
     * <code>null</code>, a new array will be allocated.  If 
     * <code>pixel</code> is not
     * <code>null</code>, it must be a primitive array of type
     * <code>transferType</code>; otherwise, a
     * <code>ClassCastException</code> is thrown.  An
     * <code>ArrayIndexOutOfBoundsException</code> is thrown if 
     * <code>pixel</code> is
     * not large enough to hold a pixel value for this
     * <code>ColorModel</code>. The pixel array is returned.
     * If this <code>transferType</code> is not supported, a
     * <code>UnsupportedOperationException</code> will be 
     * thrown.  Since <code>ColorModel</code> is an abstract class,
     * any instance is an instance of a subclass.  Subclasses must
     * override this method since the implementation in this abstract
     * class throws an <code>UnsupportedOperationException</code>.
     * @param rgb the integer pixel representation in the default RGB
     * color model
     * @param pixel the specified pixel
     * @return an array representation of the specified pixel in this
     * <code>ColorModel</code>.
     * @throws ClassCastException if <code>pixel</code>
     *  is not a primitive array of type <code>transferType</code>
     * @throws ArrayIndexOutOfBoundsException if
     *  <code>pixel</code> is not large enough to hold a pixel value
     *  for this <code>ColorModel</code>
     * @throws UnsupportedOperationException if this
     *  method is not supported by this <code>ColorModel</code> 
     * @see WritableRaster#setDataElements
     * @see SampleModel#setDataElements
     */
public Object getDataElements(int rgb, Object pixel) {
    throw new UnsupportedOperationException('This method is not supported by this color model.');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.parsers.DocumentBuilder.getSchema()

/** Get a reference to the the {@link Schema} being used by
     * the XML processor.
     * If no schema is being used, <code>null</code> is returned.
     * @return {@link Schema} being used or <code>null</code>
     *  if none in use
     * @throws UnsupportedOperationException
     *      For backward compatibility, when implementations for
     *      earlier versions of JAXP is used, this exception will be
     *      thrown.
     * @since 1.5
     */
public Schema getSchema() {
    throw new UnsupportedOperationException('This parser does not support specification \'' + this.getClass().getPackage().getSpecificationTitle() + '\' version \'' + this.getClass().getPackage().getSpecificationVersion() + '\'');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.parsers.DocumentBuilder.isXIncludeAware()

/**
     * Get the XInclude processing mode for this parser.
     * @return
     *      the return value of
     *      the {@link DocumentBuilderFactory#isXIncludeAware()}
     *      when this parser was created from factory.
     * @throws UnsupportedOperationException
     *      For backward compatibility, when implementations for
     *      earlier versions of JAXP is used, this exception will be
     *      thrown.
     * @since 1.5
     * @see DocumentBuilderFactory#setXIncludeAware(boolean)
     */
public boolean isXIncludeAware() {
    throw new UnsupportedOperationException('This parser does not support specification \'' + this.getClass().getPackage().getSpecificationTitle() + '\' version \'' + this.getClass().getPackage().getSpecificationVersion() + '\'');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.parsers.DocumentBuilderFactory.getSchema()

/**
     * Gets the {@link Schema} object specified through
     * the {@link #setSchema(Schema schema)} method.
     * 
     * @throws UnsupportedOperationException
     *      For backward compatibility, when implementations for
     *      earlier versions of JAXP is used, this exception will be
     *      thrown.
     * @return
     *      the {@link Schema} object that was last set through
     *      the {@link #setSchema(Schema)} method, or null
     *      if the method was not invoked since a {@link SAXParserFactory}
     *      is created.
     * @since 1.5
     */
public Schema getSchema() {
    throw new UnsupportedOperationException('This parser does not support specification \'' + this.getClass().getPackage().getSpecificationTitle() + '\' version \'' + this.getClass().getPackage().getSpecificationVersion() + '\'');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.parsers.DocumentBuilderFactory.isXIncludeAware()

/**
     * Get state of XInclude processing.
     * @return current state of XInclude processing
     * @throws UnsupportedOperationException
     *      For backward compatibility, when implementations for
     *      earlier versions of JAXP is used, this exception will be
     *      thrown.
     * @since 1.5
     */
public boolean isXIncludeAware() {
    throw new UnsupportedOperationException('This parser does not support specification \'' + this.getClass().getPackage().getSpecificationTitle() + '\' version \'' + this.getClass().getPackage().getSpecificationVersion() + '\'');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.parsers.DocumentBuilderFactory.setSchema(Schema)

/**
     * Set the {@link Schema} to be used by parsers created
     * from this factory.
     * 
     * When a {@link Schema} is non-null, a parser will use a validator
     * created from it to validate documents before it passes information
     * down to the application.
     * When errors are found by the validator, the parser is responsible
     * to report them to the user-specified {@link org.w3c.dom.DOMErrorHandler}
     * (or if the error handler is not set, ignore them or throw them), just
     * like any other errors found by the parser itself.
     * In other words, if the user-specified {@link org.w3c.dom.DOMErrorHandler}
     * is set, it must receive those errors, and if not, they must be
     * treated according to the implementation specific
     * default error handling rules.
     * 
     * A validator may modify the outcome of a parse (for example by
     * adding default values that were missing in documents), and a parser
     * is responsible to make sure that the application will receive
     * modified DOM trees.  
     * 
     * Initialy, null is set as the {@link Schema}. 
     * 
     * This processing will take effect even if
     * the {@link #isValidating()} method returns <tt>false</tt>.
     * It is an error to use
     * the <code>http://java.sun.com/xml/jaxp/properties/schemaSource</code>
     * property and/or the <code>http://java.sun.com/xml/jaxp/properties/schemaLanguage</code>
     * property in conjunction with a {@link Schema} object.
     * Such configuration will cause a {@link ParserConfigurationException}
     * exception when the {@link #newDocumentBuilder()} is invoked.
     *  
     * <h4>Note for implmentors</h4>
     * A parser must be able to work with any {@link Schema}
     * implementation. However, parsers and schemas are allowed
     * to use implementation-specific custom mechanisms
     * as long as they yield the result described in the specification.
     * @param schema <code>Schema</code> to use or <code>null</code> to remove a schema.
     * @throws UnsupportedOperationException
     *      For backward compatibility, when implementations for
     *      earlier versions of JAXP is used, this exception will be
     *      thrown.
     * @since 1.5
     */
public void setSchema(Schema schema) {
    throw new UnsupportedOperationException('This parser does not support specification \'' + this.getClass().getPackage().getSpecificationTitle() + '\' version \'' + this.getClass().getPackage().getSpecificationVersion() + '\'');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.parsers.DocumentBuilderFactory.setXIncludeAware(boolean)

/**
     * Set state of XInclude processing.
     * If XInclude markup is found in the document instance, should it be
     * processed as specified in <a href='http://www.w3.org/TR/xinclude/'>
     * XML Inclusions (XInclude) Version 1.0</a>.
     * XInclude processing defaults to <code>false</code>.
     * @param state Set XInclude processing to <code>true</code> or
     *   <code>false</code>
     * @throws UnsupportedOperationException
     *      For backward compatibility, when implementations for
     *      earlier versions of JAXP is used, this exception will be
     *      thrown.
     * @since 1.5
     */
public void setXIncludeAware(final boolean state) {
    throw new UnsupportedOperationException('This parser does not support specification \'' + this.getClass().getPackage().getSpecificationTitle() + '\' version \'' + this.getClass().getPackage().getSpecificationVersion() + '\'');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.parsers.SAXParser.getSchema()

/** Get a reference to the the {@link Schema} being used by
     * the XML processor.
     * If no schema is being used, <code>null</code> is returned.
     * @return {@link Schema} being used or <code>null</code>
     *  if none in use
     * @throws UnsupportedOperationException
     *      For backward compatibility, when implementations for
     *      earlier versions of JAXP is used, this exception will be
     *      thrown.
     * @since 1.5
     */
public Schema getSchema() {
    throw new UnsupportedOperationException('This parser does not support specification \'' + this.getClass().getPackage().getSpecificationTitle() + '\' version \'' + this.getClass().getPackage().getSpecificationVersion() + '\'');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.parsers.SAXParser.isXIncludeAware()

/**
     * Get the XInclude processing mode for this parser.
     * @return
     *      the return value of
     *      the {@link SAXParserFactory#isXIncludeAware()}
     *      when this parser was created from factory.
     * @throws UnsupportedOperationException
     *      For backward compatibility, when implementations for
     *      earlier versions of JAXP is used, this exception will be
     *      thrown.
     * @since 1.5
     * @see SAXParserFactory#setXIncludeAware(boolean)
     */
public boolean isXIncludeAware() {
    throw new UnsupportedOperationException('This parser does not support specification \'' + this.getClass().getPackage().getSpecificationTitle() + '\' version \'' + this.getClass().getPackage().getSpecificationVersion() + '\'');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.parsers.SAXParserFactory.getSchema()

/**
     * Gets the {@link Schema} object specified through
     * the {@link #setSchema(Schema schema)} method.
     * 
     * @throws UnsupportedOperationException
     *      For backward compatibility, when implementations for
     *      earlier versions of JAXP is used, this exception will be
     *      thrown.
     * @return
     *      the {@link Schema} object that was last set through
     *      the {@link #setSchema(Schema)} method, or null
     *      if the method was not invoked since a {@link SAXParserFactory}
     *      is created.
     * @since 1.5
     */
public Schema getSchema() {
    throw new UnsupportedOperationException('This parser does not support specification \'' + this.getClass().getPackage().getSpecificationTitle() + '\' version \'' + this.getClass().getPackage().getSpecificationVersion() + '\'');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.parsers.SAXParserFactory.isXIncludeAware()

/**
     * Get state of XInclude processing.
     * @return current state of XInclude processing
     * @throws UnsupportedOperationException
     *      For backward compatibility, when implementations for
     *      earlier versions of JAXP is used, this exception will be
     *      thrown.
     * @since 1.5
     */
public boolean isXIncludeAware() {
    throw new UnsupportedOperationException('This parser does not support specification \'' + this.getClass().getPackage().getSpecificationTitle() + '\' version \'' + this.getClass().getPackage().getSpecificationVersion() + '\'');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.parsers.SAXParserFactory.setSchema(Schema)

/**
     * Set the {@link Schema} to be used by parsers created
     * from this factory.
     * When a {@link Schema} is non-null, a parser will use a validator
     * created from it to validate documents before it passes information
     * down to the application.
     * When warnings/errors/fatal errors are found by the validator, the parser must
     * handle them as if those errors were found by the parser itself. 
     * In other words, if the user-specified {@link org.xml.sax.ErrorHandler}
     * is set, it must receive those errors, and if not, they must be
     * treated according to the implementation specific
     * default error handling rules.
     * A validator may modify the SAX event stream (for example by
     * adding default values that were missing in documents), and a parser
     * is responsible to make sure that the application will receive
     * those modified event stream.  
     * Initialy, <code>null</code> is set as the {@link Schema}. 
     * This processing will take effect even if
     * the {@link #isValidating()} method returns <code>false</code>.
     * It is an error to use
     * the <code>http://java.sun.com/xml/jaxp/properties/schemaSource</code>
     * property and/or the <code>http://java.sun.com/xml/jaxp/properties/schemaLanguage</code>
     * property in conjunction with a non-null {@link Schema} object.
     * Such configuration will cause a {@link SAXException}
     * exception when those properties are set on a {@link SAXParser}.
     * <h4>Note for implmentors</h4>
     * A parser must be able to work with any {@link Schema}
     * implementation. However, parsers and schemas are allowed
     * to use implementation-specific custom mechanisms
     * as long as they yield the result described in the specification.
     * 
     * @param schema <code>Schema</code> to use, <code>null</code> to remove a schema.
     * @throws UnsupportedOperationException
     *      For backward compatibility, when implementations for
     *      earlier versions of JAXP is used, this exception will be
     *      thrown.
     * @since 1.5
     */
public void setSchema(Schema schema) {
    throw new UnsupportedOperationException('This parser does not support specification \'' + this.getClass().getPackage().getSpecificationTitle() + '\' version \'' + this.getClass().getPackage().getSpecificationVersion() + '\'');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.parsers.SAXParserFactory.setXIncludeAware(boolean)

/**
     * Set state of XInclude processing.
     * If XInclude markup is found in the document instance, should it be
     * processed as specified in <a href='http://www.w3.org/TR/xinclude/'>
     * XML Inclusions (XInclude) Version 1.0</a>.
     * XInclude processing defaults to <code>false</code>.
     * @param state Set XInclude processing to <code>true</code> or
     *   <code>false</code>
     * @throws UnsupportedOperationException
     *      For backward compatibility, when implementations for
     *      earlier versions of JAXP is used, this exception will be
     *      thrown.
     * @since 1.5
     */
public void setXIncludeAware(final boolean state) {
    throw new UnsupportedOperationException('This parser does not support specification \'' + this.getClass().getPackage().getSpecificationTitle() + '\' version \'' + this.getClass().getPackage().getSpecificationVersion() + '\'');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageReader.readThumbnail(int, int)

/**
     * Returns the thumbnail preview image indexed by
     * <code>thumbnailIndex</code>, associated with the image indexed
     * by <code>ImageIndex</code> as a <code>BufferedImage</code>.
     *  Any registered <code>IIOReadProgressListener</code> objects
     * will be notified by calling their
     * <code>thumbnailStarted</code>, <code>thumbnailProgress</code>,
     * and <code>thumbnailComplete</code> methods.
     *  If the reader does not support thumbnails,
     * (<code>readerSupportsThumbnails</code> returns
     * <code>false</code>), an <code>UnsupportedOperationException</code>
     * will be thrown regardless of whether an input source has been
     * set or whether the indices are in bounds.
     *  The default implementation throws an
     * <code>UnsupportedOperationException</code>.
     * @param imageIndex the index of the image to be retrieved.
     * @param thumbnailIndex the index of the thumbnail to be retrieved.
     * @return the desired thumbnail as a <code>BufferedImage</code>.
     * @exception UnsupportedOperationException if thumbnails are not
     * supported.
     * @exception IllegalStateException if the input source has not been set.
     * @exception IndexOutOfBoundsException if either of the supplied
     * indices are out of bounds.
     * @exception IOException if an error occurs during reading.
     */
public BufferedImage readThumbnail(int imageIndex, int thumbnailIndex) throws IOException {
    throw new UnsupportedOperationException('Thumbnails not supported!');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.getPreferredTileSizes()

/**
     * Returns an array of <code>Dimension</code>s indicating the
     * legal size ranges for tiles as they will be encoded in the
     * output file or stream.  The returned array is a copy.
     *  The information is returned as a set of pairs; the first
     * element of a pair contains an (inclusive) minimum width and
     * height, and the second element contains an (inclusive) maximum
     * width and height.  Together, each pair defines a valid range of
     * sizes.  To specify a fixed size, use the same width and height
     * for both elements.  To specify an arbitrary range, a value of
     * <code>null</code> is used in place of an actual array of
     * <code>Dimension</code>s.
     *  If no array is specified on the constructor, but tiling is
     * allowed, then this method returns <code>null</code>.
     * @exception UnsupportedOperationException if the plug-in does
     * not support tiling.
     * @return an array of <code>Dimension</code>s with an even length
     * of at least two, or <code>null</code>.
     */
public Dimension[] getPreferredTileSizes() {
    if (!canWriteTiles()) {
        throw new UnsupportedOperationException('Tiling not supported');
    }
    return clonePreferredTileSizes(preferredTileSizes);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.getTilingMode()

/**
     * Returns the current tiling mode, if tiling is supported.
     * Otherwise throws an <code>UnsupportedOperationException</code>.
     * @return the current tiling mode.
     * @exception UnsupportedOperationException if
     * <code>canWriteTiles</code> returns <code>false</code>.
     * @see #setTilingMode
     */
public int getTilingMode() {
    if (!canWriteTiles()) {
        throw new UnsupportedOperationException('Tiling not supported');
    }
    return tilingMode;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.getTileGridXOffset()

/**
     * Returns the horizontal tile grid offset of an image as it will
     * be written to the output stream.  If tiling parameters have not
     * been set, an <code>IllegalStateException</code> is thrown.
     * @return the tile grid X offset to be used for encoding.
     * @exception UnsupportedOperationException if the plug-in does not
     * support tiling.
     * @exception IllegalStateException if the tiling mode is not
     * <code>MODE_EXPLICIT</code>.
     * @exception IllegalStateException if the tiling parameters have
     * not been set.
     * @see #setTiling(int, int, int, int)
     * @see #getTileGridYOffset()
     */
public int getTileGridXOffset() {
    if (!canWriteTiles()) {
        throw new UnsupportedOperationException('Tiling not supported!');
    }
    if (getTilingMode() != MODE_EXPLICIT) {
        throw new IllegalStateException('Tiling mode not MODE_EXPLICIT!');
    }
    if (!tilingSet) {
        throw new IllegalStateException('Tiling parameters not set!');
    }
    return tileGridXOffset;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.getTileGridYOffset()

/**
     * Returns the vertical tile grid offset of an image as it will
     * be written to the output stream.  If tiling parameters have not
     * been set, an <code>IllegalStateException</code> is thrown.
     * @return the tile grid Y offset to be used for encoding.
     * @exception UnsupportedOperationException if the plug-in does not
     * support tiling.
     * @exception IllegalStateException if the tiling mode is not
     * <code>MODE_EXPLICIT</code>.
     * @exception IllegalStateException if the tiling parameters have
     * not been set.
     * @see #setTiling(int, int, int, int)
     * @see #getTileGridXOffset()
     */
public int getTileGridYOffset() {
    if (!canWriteTiles()) {
        throw new UnsupportedOperationException('Tiling not supported!');
    }
    if (getTilingMode() != MODE_EXPLICIT) {
        throw new IllegalStateException('Tiling mode not MODE_EXPLICIT!');
    }
    if (!tilingSet) {
        throw new IllegalStateException('Tiling parameters not set!');
    }
    return tileGridYOffset;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.getTileHeight()

/**
     * Returns the height of each tile in an image as it will be written to
     * the output stream.  If tiling parameters have not
     * been set, an <code>IllegalStateException</code> is thrown.
     * @return the tile height to be used for encoding.
     * @exception UnsupportedOperationException if the plug-in does not
     * support tiling.
     * @exception IllegalStateException if the tiling mode is not
     * <code>MODE_EXPLICIT</code>.
     * @exception IllegalStateException if the tiling parameters have
     * not been set.
     * @see #setTiling(int, int, int, int)
     * @see #getTileWidth()
     */
public int getTileHeight() {
    if (!canWriteTiles()) {
        throw new UnsupportedOperationException('Tiling not supported!');
    }
    if (getTilingMode() != MODE_EXPLICIT) {
        throw new IllegalStateException('Tiling mode not MODE_EXPLICIT!');
    }
    if (!tilingSet) {
        throw new IllegalStateException('Tiling parameters not set!');
    }
    return tileHeight;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.getTileWidth()

/**
     * Returns the width of each tile in an image as it will be
     * written to the output stream.  If tiling parameters have not
     * been set, an <code>IllegalStateException</code> is thrown.
     * @return the tile width to be used for encoding.
     * @exception UnsupportedOperationException if the plug-in does not
     * support tiling.
     * @exception IllegalStateException if the tiling mode is not
     * <code>MODE_EXPLICIT</code>.
     * @exception IllegalStateException if the tiling parameters have
     * not been set.
     * @see #setTiling(int, int, int, int)
     * @see #getTileHeight()
     */
public int getTileWidth() {
    if (!canWriteTiles()) {
        throw new UnsupportedOperationException('Tiling not supported!');
    }
    if (getTilingMode() != MODE_EXPLICIT) {
        throw new IllegalStateException('Tiling mode not MODE_EXPLICIT!');
    }
    if (!tilingSet) {
        throw new IllegalStateException('Tiling parameters not set!');
    }
    return tileWidth;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.setTilingMode(int)

/**
     * Determines whether the image will be tiled in the output
     * stream and, if it will, how the tiling parameters will be 
     * determined.  The modes are interpreted as follows:
     * <ul>
     * <li><code>MODE_DISABLED</code> - The image will not be tiled.
     * <code>setTiling</code> will throw an
     * <code>IllegalStateException</code>.
     * <li><code>MODE_DEFAULT</code> - The image will be tiled using
     * default parameters.  <code>setTiling</code> will throw an
     * <code>IllegalStateException</code>.
     * <li><code>MODE_EXPLICIT</code> - The image will be tiled
     * according to parameters given in the {@link #setTiling
     * <code>setTiling</code>} method.  Any previously set tiling
     * parameters are discarded.
     * <li><code>MODE_COPY_FROM_METADATA</code> - The image will
     * conform to the metadata object passed in to a write.
     * <code>setTiling</code> will throw an
     * <code>IllegalStateException</code>.
     * </ul>
     * @param mode The mode to use for tiling.
     * @exception UnsupportedOperationException if
     * <code>canWriteTiles</code> returns <code>false</code>.
     * @exception IllegalArgumentException if <code>mode</code> is not
     * one of the modes listed above.
     * @see #setTiling
     * @see #getTilingMode
     */
public void setTilingMode(int mode) {
    if (canWriteTiles() == false) {
        throw new UnsupportedOperationException('Tiling not supported!');
    }
    if (mode < MODE_DISABLED || mode > MAX_MODE) {
        throw new IllegalArgumentException('Illegal value for mode!');
    }
    this.tilingMode = mode;
    if (mode == MODE_EXPLICIT) {
        unsetTiling();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriteParam.unsetTiling()

/**
     * Removes any previous tile grid parameters specified by calls to
     * <code>setTiling</code>.
     *  The default implementation sets the instance variables
     * <code>tileWidth</code>, <code>tileHeight</code>,
     * <code>tileGridXOffset</code>, and
     * <code>tileGridYOffset</code> to <code>0</code>.
     * @exception UnsupportedOperationException if the plug-in does not
     * support tiling.
     * @exception IllegalStateException if the tiling mode is not
     * <code>MODE_EXPLICIT</code>.
     * @see #setTiling(int, int, int, int)
     */
public void unsetTiling() {
    if (!canWriteTiles()) {
        throw new UnsupportedOperationException('Tiling not supported!');
    }
    if (getTilingMode() != MODE_EXPLICIT) {
        throw new IllegalStateException('Tiling mode not MODE_EXPLICIT!');
    }
    this.tilingSet = false;
    this.tileWidth = 0;
    this.tileHeight = 0;
    this.tileGridXOffset = 0;
    this.tileGridYOffset = 0;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.Toolkit.getLockingKeyState(int)

/**
     * Returns whether the given locking key on the keyboard is currently in
     * its 'on' state.
     * Valid key codes are
     * {@link java.awt.event.KeyEvent#VK_CAPS_LOCK VK_CAPS_LOCK},
     * {@link java.awt.event.KeyEvent#VK_NUM_LOCK VK_NUM_LOCK},
     * {@link java.awt.event.KeyEvent#VK_SCROLL_LOCK VK_SCROLL_LOCK}, and
     * {@link java.awt.event.KeyEvent#VK_KANA_LOCK VK_KANA_LOCK}.
     * @exception java.lang.IllegalArgumentException if <code>keyCode</code>
     * is not one of the valid key codes
     * @exception java.lang.UnsupportedOperationException if the host system doesn't
     * allow getting the state of this key programmatically, or if the keyboard
     * doesn't have this key
     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
     * returns true
     * @see       java.awt.GraphicsEnvironment#isHeadless
     * @since 1.3
     */
public boolean getLockingKeyState(int keyCode) throws UnsupportedOperationException {
    if (!(keyCode == KeyEvent.VK_CAPS_LOCK || keyCode == KeyEvent.VK_NUM_LOCK || keyCode == KeyEvent.VK_SCROLL_LOCK || keyCode == KeyEvent.VK_KANA_LOCK)) {
        throw new IllegalArgumentException('invalid key for Toolkit.getLockingKeyState');
    }
    throw new UnsupportedOperationException('Toolkit.getLockingKeyState');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.Toolkit.setLockingKeyState(int, boolean)

/**
     * Sets the state of the given locking key on the keyboard.
     * Valid key codes are
     * {@link java.awt.event.KeyEvent#VK_CAPS_LOCK VK_CAPS_LOCK},
     * {@link java.awt.event.KeyEvent#VK_NUM_LOCK VK_NUM_LOCK},
     * {@link java.awt.event.KeyEvent#VK_SCROLL_LOCK VK_SCROLL_LOCK}, and
     * {@link java.awt.event.KeyEvent#VK_KANA_LOCK VK_KANA_LOCK}.
     * Depending on the platform, setting the state of a locking key may
     * involve event processing and therefore may not be immediately
     * observable through getLockingKeyState.
     * @exception java.lang.IllegalArgumentException if <code>keyCode</code>
     * is not one of the valid key codes
     * @exception java.lang.UnsupportedOperationException if the host system doesn't
     * allow setting the state of this key programmatically, or if the keyboard
     * doesn't have this key
     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
     * returns true
     * @see       java.awt.GraphicsEnvironment#isHeadless
     * @since 1.3
     */
public void setLockingKeyState(int keyCode, boolean on) throws UnsupportedOperationException {
    if (!(keyCode == KeyEvent.VK_CAPS_LOCK || keyCode == KeyEvent.VK_NUM_LOCK || keyCode == KeyEvent.VK_SCROLL_LOCK || keyCode == KeyEvent.VK_KANA_LOCK)) {
        throw new IllegalArgumentException('invalid key for Toolkit.setLockingKeyState');
    }
    throw new UnsupportedOperationException('Toolkit.setLockingKeyState');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageWriter.unsupported()

private void unsupported() {
    if (getOutput() == null) {
        throw new IllegalStateException('getOutput() == null!');
    }
    throw new UnsupportedOperationException('Unsupported write variant!');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.imageio.plugins.png.PNGImageWriter.write(IIOMetadata, IIOImage, ImageWriteParam)

public void write(IIOMetadata streamMetadata, IIOImage image, ImageWriteParam param) throws IIOException {
    if (stream == null) {
        throw new IllegalStateException('output == null!');
    }
    if (image == null) {
        throw new IllegalArgumentException('image == null!');
    }
    if (image.hasRaster()) {
        throw new UnsupportedOperationException('image has a Raster!');
    }
    RenderedImage im = image.getRenderedImage();
    SampleModel sampleModel = im.getSampleModel();
    this.numBands = sampleModel.getNumBands();
    this.sourceXOffset = im.getMinX();
    this.sourceYOffset = im.getMinY();
    this.sourceWidth = im.getWidth();
    this.sourceHeight = im.getHeight();
    this.sourceBands = null;
    this.periodX = 1;
    this.periodY = 1;
    if (param != null) {
        Rectangle sourceRegion = param.getSourceRegion();
        if (sourceRegion != null) {
            Rectangle imageBounds = new Rectangle(im.getMinX(), im.getMinY(), im.getWidth(), im.getHeight());
            sourceRegion = sourceRegion.intersection(imageBounds);
            sourceXOffset = sourceRegion.x;
            sourceYOffset = sourceRegion.y;
            sourceWidth = sourceRegion.width;
            sourceHeight = sourceRegion.height;
        }
        int gridX = param.getSubsamplingXOffset();
        int gridY = param.getSubsamplingYOffset();
        sourceXOffset += gridX;
        sourceYOffset += gridY;
        sourceWidth -= gridX;
        sourceHeight -= gridY;
        periodX = param.getSourceXSubsampling();
        periodY = param.getSourceYSubsampling();
        int[] sBands = param.getSourceBands();
        if (sBands != null) {
            sourceBands = sBands;
            numBands = sourceBands.length;
        }
    }
    int destWidth = (sourceWidth + periodX - 1) / periodX;
    int destHeight = (sourceHeight + periodY - 1) / periodY;
    if (destWidth <= 0 || destHeight <= 0) {
        throw new IllegalArgumentException('Empty source region!');
    }
    this.totalPixels = destWidth * destHeight;
    this.pixelsDone = 0;
    IIOMetadata imd = image.getMetadata();
    if (imd != null) {
        metadata = (PNGMetadata) convertImageMetadata(imd, ImageTypeSpecifier.createFromRenderedImage(im), null);
    } else {
        metadata = new PNGMetadata();
    }
    if (param != null) {
        switch(param.getProgressiveMode()) {
            case ImageWriteParam.MODE_DEFAULT:
                metadata.IHDR_interlaceMethod = 1;
                break;
            case ImageWriteParam.MODE_DISABLED:
                metadata.IHDR_interlaceMethod = 0;
                break;
        }
    }
    metadata.initialize(new ImageTypeSpecifier(im), numBands);
    metadata.IHDR_width = destWidth;
    metadata.IHDR_height = destHeight;
    this.bpp = numBands * ((metadata.IHDR_bitDepth == 16) ? 2 : 1);
    initializeScaleTables(sampleModel.getSampleSize());
    clearAbortRequest();
    processImageStarted(0);
    try {
        write_magic();
        write_IHDR();
        write_cHRM();
        write_gAMA();
        write_iCCP();
        write_sBIT();
        write_sRGB();
        write_PLTE();
        write_hIST();
        write_tRNS();
        write_bKGD();
        write_pHYs();
        write_sPLT();
        write_tIME();
        write_tEXt();
        write_iTXt();
        write_zTXt();
        writeUnknownChunks();
        write_IDAT(im);
        if (abortRequested()) {
            processWriteAborted();
        } else {
            writeIEND();
            processImageComplete();
        }
    } catch (IOException e) {
        throw new IIOException('I/O error writing PNG file!', e);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageReader.readRaster(int, ImageReadParam)

/**
     * Returns a new <code>Raster</code> object containing the raw pixel data
     * from the image stream, without any color conversion applied.  The 
     * application must determine how to interpret the pixel data by other
     * means.  Any destination or image-type parameters in the supplied
     * <code>ImageReadParam</code> object are ignored, but all other
     * parameters are used exactly as in the {@link #read <code>read</code>}
     * method, except that any destination offset is used as a logical rather
     * than a physical offset.  The size of the returned <code>Raster</code>
     * will always be that of the source region clipped to the actual image.
     * Logical offsets in the stream itself are ignored.
     *  This method allows formats that normally apply a color
     * conversion, such as JPEG, and formats that do not normally have an
     * associated colorspace, such as remote sensing or medical imaging data,
     * to provide access to raw pixel data.
     *  Any registered <code>readUpdateListener</code>s are ignored, as
     * there is no <code>BufferedImage</code>, but all other listeners are
     * called exactly as they are for the {@link #read <code>read</code>}
     * method.
     *  If {@link #canReadRaster <code>canReadRaster()</code>} returns
     * <code>false</code>, this method throws an 
     * <code>UnsupportedOperationException</code>.
     *  If the supplied <code>ImageReadParam</code> contains
     * optional setting values not supported by this reader (<i>e.g.</i>
     * source render size or any format-specific settings), they will
     * be ignored.
     *  The default implementation throws an 
     * <code>UnsupportedOperationException</code>.
     * @param imageIndex the index of the image to be read.
     * @param param an <code>ImageReadParam</code> used to control
     * the reading process, or <code>null</code>.
     * @return the desired portion of the image as a
     * <code>Raster</code>.
     * @exception UnsupportedOperationException if this plug-in does not
     * support reading raw <code>Raster</code>s.
     * @exception IllegalStateException if the input source has not been
     * set.
     * @exception IndexOutOfBoundsException if the supplied index is
     * out of bounds.
     * @exception IOException if an error occurs during reading.
     * @see #canReadRaster
     * @see #read
     * @see java.awt.image.Raster
     */
public Raster readRaster(int imageIndex, ImageReadParam param) throws IOException {
    throw new UnsupportedOperationException('readRaster not supported!');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.ImageReader.readTileRaster(int, int, int)

/**
     * Returns a new <code>Raster</code> object containing the raw
     * pixel data from the tile, without any color conversion applied.
     * The application must determine how to interpret the pixel data by other
     * means.  
     *  If {@link #canReadRaster <code>canReadRaster()</code>} returns
     * <code>false</code>, this method throws an 
     * <code>UnsupportedOperationException</code>.
     *  The default implementation checks if reading
     * <code>Raster</code>s is supported, and if so calls {@link
     * #readRaster <code>readRaster(imageIndex, null)</code>} if
     * <code>tileX</code> and <code>tileY</code> are 0, or throws an
     * <code>IllegalArgumentException</code> otherwise.
     * @param imageIndex the index of the image to be retrieved.
     * @param tileX the column index (starting with 0) of the tile
     * to be retrieved.
     * @param tileY the row index (starting with 0) of the tile
     * to be retrieved.
     * @return the tile as a <code>Raster</code>.
     * @exception UnsupportedOperationException if this plug-in does not
     * support reading raw <code>Raster</code>s.
     * @exception IllegalArgumentException if the tile indices are
     * out of bounds.
     * @exception IllegalStateException if the input source has not been
     * set.
     * @exception IndexOutOfBoundsException if <code>imageIndex</code>
     * is out of bounds.
     * @exception IOException if an error occurs during reading.
     * @see #readTile
     * @see #readRaster
     * @see java.awt.image.Raster
     */
public Raster readTileRaster(int imageIndex, int tileX, int tileY) throws IOException {
    if (!canReadRaster()) {
        throw new UnsupportedOperationException('readTileRaster not supported!');
    }
    if ((tileX != 0) || (tileY != 0)) {
        throw new IllegalArgumentException('Invalid tile indices');
    }
    return readRaster(imageIndex, null);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

Comments

Popular posts from this blog

BAD_CERTIFICATE - A corrupt or unuseable certificate...

This is a simple symptom-cause-solution blog entry only. I hope these blogs will help fellow administrators.
Symptom
In wls_utc, when trying to test a webservice using SSL, the following error message is received: javax.net.ssl.SSLKeyException: FATAL Alert:BAD_CERTIFICATE - A corrupt or unuseable certificate was received.
If SSL debugging is enabled, the following error also appears in the logs: ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)' <1254822672320>>
verification failed because RSA key public exponent [3] is too small
Cause
The certificate encryption is of a weaker strength than expected by newer versions of Java.
Solution
Add the flag "-Dweblogic.security.SSL.allowSmallRSAExponent=true" to the server startup parameters.
References


None.

Connection refused: No available router to destination

This is a simple symptom-cause-solution blog entry only. I hope these blogs will help fellow administrators.
Symptom

The following exception occurs in WebLogic server logs. Most likely to occur during WebLogic server start-up, but similar exceptions may occur at other times.
java.net.ConnectException: t3://myserver:8000: Destination unreachable; nested exception is: java.net.ConnectException: Connection refused: connect; No available router to destination] at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:49) at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:773) at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:363) at weblogic.jndi.Environment.getContext(Environment.java:307) at weblogic.jndi.Environment.getContext(Environment.java:277)
Cause
This message (Connection refused: connect; No available router to destination) is a kind of "catch…

WebLogic Admin Console

WebLogic Admin Console
The WebLogic Admin Console is a web-based, user interface used to configure and control a set of WebLogic servers or clusters (i.e. a "domain"). In any logical group of WebLogic servers there must exist one admin server, which hosts the WebLogic Admin Console application and manages the associated configuration files.
WebLogic Administrators will use the Administration Console for a number of tasks, including:
Starting and stopping WebLogic servers or entire clusters.Configuring server parameters, security, database connections and deployed applications.Viewing server status, health and metrics. Note: It is not strictly necessary to use the Weblogic Admin Console to perform these tasks, as they can be scripted using WLST (the WebLogic Scripting Tool).
Accessing the Admin Console
WebLogic Admin Console Url: http://hostname:port/console.
To access the WebLogic Administration Console, assuming the admin server has been started, goto the above url. Where hostname…