org.geotools.resources.image
Class JAIUtilities

java.lang.Object
  extended byorg.geotools.resources.image.JAIUtilities

public final class JAIUtilities
extends java.lang.Object

A set of utilities methods working on JAI classes. Those method should be considered as temporary. They will be removed if Sun extends their class with the fonctionality provided here.

Version:
$Id: JAIUtilities.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux

Method Summary
static void add(javax.media.jai.IntegerSequence sequence, javax.media.jai.IntegerSequence toAdd, int offset)
          Copy all the value from toAdd in the given sequence while adding the specified offset to each value.
static boolean contains(javax.media.jai.IntegerSequence sequence, int value)
          Returns true if the given sequence contains the given value.
static boolean containsAll(javax.media.jai.IntegerSequence sequence, int lower, int upper)
          Returns true if the given sequence contains all values in the given range.
static boolean containsAny(javax.media.jai.IntegerSequence sequence, int lower, int upper)
          Returns true if the given sequence contains any value in the given range.
static javax.media.jai.IntegerSequence createSequence(int min, int max)
          Workaround for IntegerSequence constructor bug.
static void fill(javax.media.jai.IntegerSequence sequence, int lower, int upper)
          Fill the specified integer sequence with numbers from lower inclusive to upper exclusive.
static int getMaximum(javax.media.jai.IntegerSequence sequence)
          Returns the maximum (last) value in the specified sequence.
static int getMinimum(javax.media.jai.IntegerSequence sequence)
          Returns the minimum (first) value in the specified sequence.
static int[] toArray(javax.media.jai.IntegerSequence sequence)
          Returns all integers in the given sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

fill

public static void fill(javax.media.jai.IntegerSequence sequence,
                        int lower,
                        int upper)
Fill the specified integer sequence with numbers from lower inclusive to upper exclusive. Nothing is done if the sequence is null.

Parameters:
sequence - The sequence to fill, or null.
lower - The lower value, inclusive.
upper - The upper value, exclusive.

add

public static void add(javax.media.jai.IntegerSequence sequence,
                       javax.media.jai.IntegerSequence toAdd,
                       int offset)
Copy all the value from toAdd in the given sequence while adding the specified offset to each value. Nothing is done if sequence is null.


getMinimum

public static int getMinimum(javax.media.jai.IntegerSequence sequence)
                      throws java.util.NoSuchElementException
Returns the minimum (first) value in the specified sequence.

Parameters:
sequence - The sequence to test for the minimum value.
Returns:
The minimum (first) value in the given sequence.
Throws:
java.util.NoSuchElementException - if there is no element in the given sequence.

getMaximum

public static int getMaximum(javax.media.jai.IntegerSequence sequence)
                      throws java.util.NoSuchElementException
Returns the maximum (last) value in the specified sequence.

Parameters:
sequence - The sequence to test for the minimum value.
Returns:
The maximum (last) value in the given sequence.
Throws:
java.util.NoSuchElementException - if there is no element in the given sequence.

contains

public static boolean contains(javax.media.jai.IntegerSequence sequence,
                               int value)
Returns true if the given sequence contains the given value.

Parameters:
sequence - The sequence to test.
value - The value to search.
Returns:
true if the sequence contains the given value.

containsAll

public static boolean containsAll(javax.media.jai.IntegerSequence sequence,
                                  int lower,
                                  int upper)
Returns true if the given sequence contains all values in the given range.

Parameters:
sequence - The sequence to test.
lower - The lower value, inclusive.
upper - The upper value, exclusive.
Returns:
true if the sequence contains all values in the given range.

containsAny

public static boolean containsAny(javax.media.jai.IntegerSequence sequence,
                                  int lower,
                                  int upper)
Returns true if the given sequence contains any value in the given range.

Parameters:
sequence - The sequence to test.
lower - The lower value, inclusive.
upper - The upper value, exclusive.
Returns:
true if the sequence contains at least one value in the given range.

toArray

public static int[] toArray(javax.media.jai.IntegerSequence sequence)
Returns all integers in the given sequence. Will be replaced by new IntegerSequence(min, max) when the bug will be fixed.


createSequence

public static javax.media.jai.IntegerSequence createSequence(int min,
                                                             int max)
Workaround for IntegerSequence constructor bug.



Copyright © GeoTools. All Rights Reserved.