This abstract class defines an interface for extracting samples of pixels in an image. All image data is expressed as a collection of pixels. Each pixel consists of a number of samples. A sample is a datum for one band of an image and a band consists of all samples of a particular type in an image. For example, a pixel might contain three samples representing its red, green and blue components. There are three bands in the image containing this pixel. One band consists of all the red samples from all pixels in the image. The second band consists of all the green samples and the remaining band consists of all of the blue samples. The pixel can be stored in various formats. For example, all samples from a particular band can be stored contiguously or all samples from a single pixel can be stored contiguously.

Subclasses of SampleModel specify the types of samples they can represent (e.g. unsigned 8-bit byte, signed 16-bit short, etc.) and may specify how the samples are organized in memory. In the Java 2D(tm) API, built-in image processing operators may not operate on all possible sample types, but generally will work for unsigned integral samples of 16 bits or less. Some operators support a wider variety of sample types.

A collection of pixels is represented as a Raster, which consists of a DataBuffer and a SampleModel. The SampleModel allows access to samples in the DataBuffer and may provide low-level information that a programmer can use to directly manipulate samples and pixels in the DataBuffer.

This class is generally a fall back method for dealing with images. More efficient code will cast the SampleModel to the appropriate subclass and extract the information needed to directly manipulate pixels in the DataBuffer.

Constructs a SampleModel with the specified parameters.
Parameters
dataTypeThe data type of the DataBuffer storing the pixel data.
wThe width (in pixels) of the region of image data.
hThe height (in pixels) of the region of image data.
numBandsThe number of bands of the image data.
Throws
IllegalArgumentExceptionif w or h is not greater than 0
IllegalArgumentExceptionif the product of w and h is greater than Integer.MAX_VALUE
IllegalArgumentExceptionif dataType is not one of the supported data types
Creates a SampleModel which describes data in this SampleModel's format, but with a different width and height.
Parameters
wthe width of the image data
hthe height of the image data
Return
a SampleModel describing the same image data as this SampleModel, but with a different size.
Creates a DataBuffer that corresponds to this SampleModel. The DataBuffer's width and height will match this SampleModel's.
Return
a DataBuffer corresponding to this SampleModel.
Creates a new SampleModel with a subset of the bands of this SampleModel.
Parameters
bandsthe subset of bands of this SampleModel
Return
a SampleModel with a subset of bands of this SampleModel.
Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true).

Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.

Parameters
objthe reference object with which to compare.
Return
true if this object is the same as the obj argument; false otherwise.
Returns the runtime class of an object. That Class object is the object that is locked by static synchronized methods of the represented class.
Return
The java.lang.Class object that represents the runtime class of the object. The result is of type {@code Class} where X is the erasure of the static type of the expression on which getClass is called.
Returns the pixel data for the specified rectangle of pixels in a primitive array of type TransferType. For image data supported by the Java 2D API, this will be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, DataBuffer.TYPE_INT, DataBuffer.TYPE_SHORT, DataBuffer.TYPE_FLOAT, or DataBuffer.TYPE_DOUBLE. Data may be returned in a packed format, thus increasing efficiency for data transfers. Generally, obj should be passed in as null, so that the Object will be created automatically and will be of the right primitive data type.

The following code illustrates transferring data for a rectangular region of pixels from DataBuffer db1, whose storage layout is described by SampleModel sm1, to DataBuffer db2, whose storage layout is described by SampleModel sm2. The transfer will generally be more efficient than using getPixels/setPixels.

 	     SampleModel sm1, sm2;
	     DataBuffer db1, db2;
 	     sm2.setDataElements(x, y, w, h, sm1.getDataElements(x, y, w,
                           h, null, db1), db2);
 
Using getDataElements/setDataElements to transfer between two DataBuffer/SampleModel pairs is legitimate if the SampleModels have the same number of bands, corresponding bands have the same number of bits per sample, and the TransferTypes are the same.

If obj is non-null, it should be a primitive array of type TransferType. Otherwise, a ClassCastException is thrown. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds, or if obj is non-null and is not large enough to hold the pixel data.

Parameters
xThe minimum X coordinate of the pixel rectangle.
yThe minimum Y coordinate of the pixel rectangle.
wThe width of the pixel rectangle.
hThe height of the pixel rectangle.
objIf non-null, a primitive array in which to return the pixel data.
dataThe DataBuffer containing the image data.
Return
the data elements for the specified region of pixels.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates are not in bounds, or if obj is too small to hold the output.
Returns data for a single pixel in a primitive array of type TransferType. For image data supported by the Java 2D API, this will be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, DataBuffer.TYPE_INT, DataBuffer.TYPE_SHORT, DataBuffer.TYPE_FLOAT, or DataBuffer.TYPE_DOUBLE. Data may be returned in a packed format, thus increasing efficiency for data transfers. Generally, obj should be passed in as null, so that the Object will be created automatically and will be of the right primitive data type.

The following code illustrates transferring data for one pixel from DataBuffer db1, whose storage layout is described by SampleModel sm1, to DataBuffer db2, whose storage layout is described by SampleModel sm2. The transfer will generally be more efficient than using getPixel/setPixel.

 	     SampleModel sm1, sm2;
	     DataBuffer db1, db2;
 	     sm2.setDataElements(x, y, sm1.getDataElements(x, y, null, db1), db2);
 
Using getDataElements/setDataElements to transfer between two DataBuffer/SampleModel pairs is legitimate if the SampleModels have the same number of bands, corresponding bands have the same number of bits per sample, and the TransferTypes are the same.

If obj is non-null, it should be a primitive array of type TransferType. Otherwise, a ClassCastException is thrown. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds, or if obj is non-null and is not large enough to hold the pixel data.

Parameters
xThe X coordinate of the pixel location.
yThe Y coordinate of the pixel location.
objIf non-null, a primitive array in which to return the pixel data.
dataThe DataBuffer containing the image data.
Return
the data elements for the specified pixel.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates are not in bounds, or if obj is too small to hold the output.
Returns the data type of the DataBuffer storing the pixel data.
Return
the data type.
Returns the height in pixels.
Return
the height in pixels of the region of image data that this SampleModel describes.
Returns the total number of bands of image data.
Return
the number of bands of image data that this SampleModel describes.
Returns the number of data elements needed to transfer a pixel via the getDataElements and setDataElements methods. When pixels are transferred via these methods, they may be transferred in a packed or unpacked format, depending on the implementation of the SampleModel. Using these methods, pixels are transferred as an array of getNumDataElements() elements of a primitive type given by getTransferType(). The TransferType may or may not be the same as the storage DataType.
Returns the samples for the specified pixel in an array of double. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the pixel location.
yThe Y coordinate of the pixel location.
dArrayIf non-null, returns the samples in this array.
dataThe DataBuffer containing the image data.
Return
the samples for the specified pixel.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates are not in bounds, or if dArray is too small to hold the output.
Returns the samples for the specified pixel in an array of float. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the pixel location.
yThe Y coordinate of the pixel location.
fArrayIf non-null, returns the samples in this array.
dataThe DataBuffer containing the image data.
Return
the samples for the specified pixel.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates are not in bounds, or if fArray is too small to hold the output.
Returns the samples for a specified pixel in an int array, one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
x, yThe coordinates of the pixel location
iArrayIf non-null, returns the samples in this array
dataThe DataBuffer containing the image data
Return
the samples for the specified pixel.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates are not in bounds, or if iArray is too small to hold the output.
Returns all samples for a rectangle of pixels in a double array, one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the upper left pixel location.
yThe Y coordinate of the upper left pixel location.
wThe width of the pixel rectangle.
hThe height of the pixel rectangle.
dArrayIf non-null, returns the samples in this array.
dataThe DataBuffer containing the image data.
Return
the samples for the specified region of pixels.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates are not in bounds, or if dArray is too small to hold the output.
Returns all samples for a rectangle of pixels in a float array, one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the upper left pixel location.
yThe Y coordinate of the upper left pixel location.
wThe width of the pixel rectangle.
hThe height of the pixel rectangle.
fArrayIf non-null, returns the samples in this array.
dataThe DataBuffer containing the image data.
Return
the samples for the specified region of pixels.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates are not in bounds, or if fArray is too small to hold the output.
Returns all samples for a rectangle of pixels in an int array, one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the upper left pixel location.
yThe Y coordinate of the upper left pixel location.
wThe width of the pixel rectangle.
hThe height of the pixel rectangle.
iArrayIf non-null, returns the samples in this array.
dataThe DataBuffer containing the image data.
Return
the samples for the specified region of pixels.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates are not in bounds, or if iArray is too small to hold the output.
Returns the sample in a specified band for the pixel located at (x,y) as an int. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the pixel location.
yThe Y coordinate of the pixel location.
bThe band to return.
dataThe DataBuffer containing the image data.
Return
the sample in a specified band for the specified pixel.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates or the band index are not in bounds.
Returns the sample in a specified band for a pixel located at (x,y) as a double. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the pixel location.
yThe Y coordinate of the pixel location.
bThe band to return.
dataThe DataBuffer containing the image data.
Return
the sample in a specified band for the specified pixel.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates or the band index are not in bounds.
Returns the sample in a specified band for the pixel located at (x,y) as a float. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the pixel location.
yThe Y coordinate of the pixel location.
bThe band to return.
dataThe DataBuffer containing the image data.
Return
the sample in a specified band for the specified pixel.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates or the band index are not in bounds.
Returns the samples for a specified band for a specified rectangle of pixels in a double array, one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the upper left pixel location.
yThe Y coordinate of the upper left pixel location.
wThe width of the pixel rectangle.
hThe height of the pixel rectangle.
bThe band to return.
dArrayIf non-null, returns the samples in this array.
dataThe DataBuffer containing the image data.
Return
the samples for the specified band for the specified region of pixels.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates or the band index are not in bounds, or if dArray is too small to hold the output.
Returns the samples for a specified band for the specified rectangle of pixels in a float array, one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the upper left pixel location.
yThe Y coordinate of the upper left pixel location.
wThe width of the pixel rectangle.
hThe height of the pixel rectangle.
bThe band to return.
fArrayIf non-null, returns the samples in this array.
dataThe DataBuffer containing the image data.
Return
the samples for the specified band for the specified region of pixels.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates or the band index are not in bounds, or if fArray is too small to hold the output.
Returns the samples for a specified band for the specified rectangle of pixels in an int array, one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the upper left pixel location.
yThe Y coordinate of the upper left pixel location.
wThe width of the pixel rectangle.
hThe height of the pixel rectangle.
bThe band to return.
iArrayIf non-null, returns the samples in this array.
dataThe DataBuffer containing the image data.
Return
the samples for the specified band for the specified region of pixels.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates or the band index are not in bounds, or if iArray is too small to hold the output.
Returns the size in bits of samples for all bands.
Return
the size of samples for all bands.
Returns the size in bits of samples for the specified band.
Parameters
bandthe specified band
Return
the size of the samples of the specified band.
Returns the TransferType used to transfer pixels via the getDataElements and setDataElements methods. When pixels are transferred via these methods, they may be transferred in a packed or unpacked format, depending on the implementation of the SampleModel. Using these methods, pixels are transferred as an array of getNumDataElements() elements of a primitive type given by getTransferType(). The TransferType may or may not be the same as the storage DataType. The TransferType will be one of the types defined in DataBuffer.
Returns the width in pixels.
Return
the width in pixels of the region of image data that this SampleModel describes.
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables.

As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

Return
a hash code value for this object.
Wakes up a single thread that is waiting on this object's monitor. If any threads are waiting on this object, one of them is chosen to be awakened. The choice is arbitrary and occurs at the discretion of the implementation. A thread waits on an object's monitor by calling one of the wait methods.

The awakened thread will not be able to proceed until the current thread relinquishes the lock on this object. The awakened thread will compete in the usual manner with any other threads that might be actively competing to synchronize on this object; for example, the awakened thread enjoys no reliable privilege or disadvantage in being the next thread to lock this object.

This method should only be called by a thread that is the owner of this object's monitor. A thread becomes the owner of the object's monitor in one of three ways:

  • By executing a synchronized instance method of that object.
  • By executing the body of a synchronized statement that synchronizes on the object.
  • For objects of type Class, by executing a synchronized static method of that class.

Only one thread at a time can own an object's monitor.

Throws
IllegalMonitorStateExceptionif the current thread is not the owner of this object's monitor.
Wakes up all threads that are waiting on this object's monitor. A thread waits on an object's monitor by calling one of the wait methods.

The awakened threads will not be able to proceed until the current thread relinquishes the lock on this object. The awakened threads will compete in the usual manner with any other threads that might be actively competing to synchronize on this object; for example, the awakened threads enjoy no reliable privilege or disadvantage in being the next thread to lock this object.

This method should only be called by a thread that is the owner of this object's monitor. See the notify method for a description of the ways in which a thread can become the owner of a monitor.

Throws
IllegalMonitorStateExceptionif the current thread is not the owner of this object's monitor.
Sets the data for a rectangle of pixels in the specified DataBuffer from a primitive array of type TransferType. For image data supported by the Java 2D API, this will be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, DataBuffer.TYPE_INT, DataBuffer.TYPE_SHORT, DataBuffer.TYPE_FLOAT, or DataBuffer.TYPE_DOUBLE. Data in the array may be in a packed format, thus increasing efficiency for data transfers.

The following code illustrates transferring data for a rectangular region of pixels from DataBuffer db1, whose storage layout is described by SampleModel sm1, to DataBuffer db2, whose storage layout is described by SampleModel sm2. The transfer will generally be more efficient than using getPixels/setPixels.

 	     SampleModel sm1, sm2;
	     DataBuffer db1, db2;
 	     sm2.setDataElements(x, y, w, h, sm1.getDataElements(x, y, w, h,
                           null, db1), db2);
 
Using getDataElements/setDataElements to transfer between two DataBuffer/SampleModel pairs is legitimate if the SampleModels have the same number of bands, corresponding bands have the same number of bits per sample, and the TransferTypes are the same.

obj must be a primitive array of type TransferType. Otherwise, a ClassCastException is thrown. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds, or if obj is not large enough to hold the pixel data.

Parameters
xThe minimum X coordinate of the pixel rectangle.
yThe minimum Y coordinate of the pixel rectangle.
wThe width of the pixel rectangle.
hThe height of the pixel rectangle.
objA primitive array containing pixel data.
dataThe DataBuffer containing the image data.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates are not in bounds, or if obj is too small to hold the input.
Sets the data for a single pixel in the specified DataBuffer from a primitive array of type TransferType. For image data supported by the Java 2D API, this will be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, DataBuffer.TYPE_INT, DataBuffer.TYPE_SHORT, DataBuffer.TYPE_FLOAT, or DataBuffer.TYPE_DOUBLE. Data in the array may be in a packed format, thus increasing efficiency for data transfers.

The following code illustrates transferring data for one pixel from DataBuffer db1, whose storage layout is described by SampleModel sm1, to DataBuffer db2, whose storage layout is described by SampleModel sm2. The transfer will generally be more efficient than using getPixel/setPixel.

 	     SampleModel sm1, sm2;
	     DataBuffer db1, db2;
 	     sm2.setDataElements(x, y, sm1.getDataElements(x, y, null, db1),
                           db2);
 
Using getDataElements/setDataElements to transfer between two DataBuffer/SampleModel pairs is legitimate if the SampleModels have the same number of bands, corresponding bands have the same number of bits per sample, and the TransferTypes are the same.

obj must be a primitive array of type TransferType. Otherwise, a ClassCastException is thrown. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds, or if obj is not large enough to hold the pixel data.

Parameters
xThe X coordinate of the pixel location.
yThe Y coordinate of the pixel location.
objA primitive array containing pixel data.
dataThe DataBuffer containing the image data.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates are not in bounds, or if obj is too small to hold the input.
Sets a pixel in the DataBuffer using a double array of samples for input.
Parameters
xThe X coordinate of the pixel location.
yThe Y coordinate of the pixel location.
dArrayThe input samples in a double array.
dataThe DataBuffer containing the image data.
Throws
NullPointerExceptionif dArray or data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates are not in bounds, or if fArray is too small to hold the input.
Sets a pixel in the DataBuffer using a float array of samples for input. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the pixel location.
yThe Y coordinate of the pixel location.
fArrayThe input samples in a float array.
dataThe DataBuffer containing the image data.
Throws
NullPointerExceptionif fArray or data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates are not in bounds, or if fArray is too small to hold the input.
Sets a pixel in the DataBuffer using an int array of samples for input. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the pixel location.
yThe Y coordinate of the pixel location.
iArrayThe input samples in an int array.
dataThe DataBuffer containing the image data.
Throws
NullPointerExceptionif iArray or data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates are not in bounds, or if iArray is too small to hold the input.
Sets all samples for a rectangle of pixels from a double array containing one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the upper left pixel location.
yThe Y coordinate of the upper left pixel location.
wThe width of the pixel rectangle.
hThe height of the pixel rectangle.
dArrayThe input samples in a double array.
dataThe DataBuffer containing the image data.
Throws
NullPointerExceptionif dArray or data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates are not in bounds, or if dArray is too small to hold the input.
Sets all samples for a rectangle of pixels from a float array containing one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the upper left pixel location.
yThe Y coordinate of the upper left pixel location.
wThe width of the pixel rectangle.
hThe height of the pixel rectangle.
fArrayThe input samples in a float array.
dataThe DataBuffer containing the image data.
Throws
NullPointerExceptionif fArray or data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates are not in bounds, or if fArray is too small to hold the input.
Sets all samples for a rectangle of pixels from an int array containing one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the upper left pixel location.
yThe Y coordinate of the upper left pixel location.
wThe width of the pixel rectangle.
hThe height of the pixel rectangle.
iArrayThe input samples in an int array.
dataThe DataBuffer containing the image data.
Throws
NullPointerExceptionif iArray or data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates are not in bounds, or if iArray is too small to hold the input.
Sets a sample in the specified band for the pixel located at (x,y) in the DataBuffer using a double for input. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the pixel location.
yThe Y coordinate of the pixel location.
bThe band to set.
sThe input sample as a double.
dataThe DataBuffer containing the image data.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates or the band index are not in bounds.
Sets a sample in the specified band for the pixel located at (x,y) in the DataBuffer using a float for input. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the pixel location.
yThe Y coordinate of the pixel location.
bThe band to set.
sThe input sample as a float.
dataThe DataBuffer containing the image data.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates or the band index are not in bounds.
Sets a sample in the specified band for the pixel located at (x,y) in the DataBuffer using an int for input. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the pixel location.
yThe Y coordinate of the pixel location.
bThe band to set.
sThe input sample as an int.
dataThe DataBuffer containing the image data.
Throws
NullPointerExceptionif data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates or the band index are not in bounds.
Sets the samples in the specified band for the specified rectangle of pixels from a double array containing one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the upper left pixel location.
yThe Y coordinate of the upper left pixel location.
wThe width of the pixel rectangle.
hThe height of the pixel rectangle.
bThe band to set.
dArrayThe input samples in a double array.
dataThe DataBuffer containing the image data.
Throws
NullPointerExceptionif dArray or data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates or the band index are not in bounds, or if dArray is too small to hold the input.
Sets the samples in the specified band for the specified rectangle of pixels from a float array containing one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the upper left pixel location.
yThe Y coordinate of the upper left pixel location.
wThe width of the pixel rectangle.
hThe height of the pixel rectangle.
bThe band to set.
fArrayThe input samples in a float array.
dataThe DataBuffer containing the image data.
Throws
NullPointerExceptionif fArray or data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates or the band index are not in bounds, or if fArray is too small to hold the input.
Sets the samples in the specified band for the specified rectangle of pixels from an int array containing one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
Parameters
xThe X coordinate of the upper left pixel location.
yThe Y coordinate of the upper left pixel location.
wThe width of the pixel rectangle.
hThe height of the pixel rectangle.
bThe band to set.
iArrayThe input samples in an int array.
dataThe DataBuffer containing the image data.
Throws
NullPointerExceptionif iArray or data is null.
ArrayIndexOutOfBoundsExceptionif the coordinates or the band index are not in bounds, or if iArray is too small to hold the input.
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 
Return
a string representation of the object.
Causes current thread to wait until another thread invokes the method or the method for this object. In other words, this method behaves exactly as if it simply performs the call wait(0).

The current thread must own this object's monitor. The thread releases ownership of this monitor and waits until another thread notifies threads waiting on this object's monitor to wake up either through a call to the notify method or the notifyAll method. The thread then waits until it can re-obtain ownership of the monitor and resumes execution.

As in the one argument version, interrupts and spurious wakeups are possible, and this method should always be used in a loop:

     synchronized (obj) {
         while (<condition does not hold>)
             obj.wait();
         ... // Perform action appropriate to condition
     }
 
This method should only be called by a thread that is the owner of this object's monitor. See the notify method for a description of the ways in which a thread can become the owner of a monitor.
Throws
IllegalMonitorStateExceptionif the current thread is not the owner of the object's monitor.
InterruptedExceptionif another thread interrupted the current thread before or while the current thread was waiting for a notification. The interrupted status of the current thread is cleared when this exception is thrown.
Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.

The current thread must own this object's monitor.

This method causes the current thread (call it T) to place itself in the wait set for this object and then to relinquish any and all synchronization claims on this object. Thread T becomes disabled for thread scheduling purposes and lies dormant until one of four things happens:

  • Some other thread invokes the notify method for this object and thread T happens to be arbitrarily chosen as the thread to be awakened.
  • Some other thread invokes the notifyAll method for this object.
  • Some other thread interrupts thread T.
  • The specified amount of real time has elapsed, more or less. If timeout is zero, however, then real time is not taken into consideration and the thread simply waits until notified.
The thread T is then removed from the wait set for this object and re-enabled for thread scheduling. It then competes in the usual manner with other threads for the right to synchronize on the object; once it has gained control of the object, all its synchronization claims on the object are restored to the status quo ante - that is, to the situation as of the time that the wait method was invoked. Thread T then returns from the invocation of the wait method. Thus, on return from the wait method, the synchronization state of the object and of thread T is exactly as it was when the wait method was invoked.

A thread can also wake up without being notified, interrupted, or timing out, a so-called spurious wakeup. While this will rarely occur in practice, applications must guard against it by testing for the condition that should have caused the thread to be awakened, and continuing to wait if the condition is not satisfied. In other words, waits should always occur in loops, like this one:

     synchronized (obj) {
         while (<condition does not hold>)
             obj.wait(timeout);
         ... // Perform action appropriate to condition
     }
 
(For more information on this topic, see Section 3.2.3 in Doug Lea's "Concurrent Programming in Java (Second Edition)" (Addison-Wesley, 2000), or Item 50 in Joshua Bloch's "Effective Java Programming Language Guide" (Addison-Wesley, 2001).

If the current thread is interrupted by another thread while it is waiting, then an InterruptedException is thrown. This exception is not thrown until the lock status of this object has been restored as described above.

Note that the wait method, as it places the current thread into the wait set for this object, unlocks only this object; any other objects on which the current thread may be synchronized remain locked while the thread waits.

This method should only be called by a thread that is the owner of this object's monitor. See the notify method for a description of the ways in which a thread can become the owner of a monitor.

Parameters
timeoutthe maximum time to wait in milliseconds.
Throws
IllegalArgumentExceptionif the value of timeout is negative.
IllegalMonitorStateExceptionif the current thread is not the owner of the object's monitor.
InterruptedExceptionif another thread interrupted the current thread before or while the current thread was waiting for a notification. The interrupted status of the current thread is cleared when this exception is thrown.
Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.

This method is similar to the wait method of one argument, but it allows finer control over the amount of time to wait for a notification before giving up. The amount of real time, measured in nanoseconds, is given by:

 1000000*timeout+nanos

In all other respects, this method does the same thing as the method of one argument. In particular, wait(0, 0) means the same thing as wait(0).

The current thread must own this object's monitor. The thread releases ownership of this monitor and waits until either of the following two conditions has occurred:

  • Another thread notifies threads waiting on this object's monitor to wake up either through a call to the notify method or the notifyAll method.
  • The timeout period, specified by timeout milliseconds plus nanos nanoseconds arguments, has elapsed.

The thread then waits until it can re-obtain ownership of the monitor and resumes execution.

As in the one argument version, interrupts and spurious wakeups are possible, and this method should always be used in a loop:

     synchronized (obj) {
         while (<condition does not hold>)
             obj.wait(timeout, nanos);
         ... // Perform action appropriate to condition
     }
 
This method should only be called by a thread that is the owner of this object's monitor. See the notify method for a description of the ways in which a thread can become the owner of a monitor.
Parameters
timeoutthe maximum time to wait in milliseconds.
nanosadditional time, in nanoseconds range 0-999999.
Throws
IllegalArgumentExceptionif the value of timeout is negative or the value of nanos is not in the range 0-999999.
IllegalMonitorStateExceptionif the current thread is not the owner of this object's monitor.
InterruptedExceptionif another thread interrupted the current thread before or while the current thread was waiting for a notification. The interrupted status of the current thread is cleared when this exception is thrown.