Class RectangularArraySummary
- java.lang.Object
-
- RJavaArrayIterator
-
- RectangularArraySummary
-
public class RectangularArraySummary extends RJavaArrayIterator
Utility class to extract something from a rectangular array
-
-
Field Summary
-
Fields inherited from class RJavaArrayIterator
array, dimensions, dimprod, increment, index, nd, position, start
-
-
Constructor Summary
Constructors Constructor Description RectangularArraySummary(java.lang.Object array, int length)
RectangularArraySummary(java.lang.Object array, int[] dimensions)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkComparableObjects()
boolean
containsComparableObjects()
java.lang.Object
max(boolean narm)
Iterates over the array to find the maximum value (in the sense of the Comparable interface)java.lang.Object
min(boolean narm)
Iterates over the array to find the minimum value (in the sense of the Comparable interface)java.lang.Object[]
range(boolean narm)
Iterates over the array to find the range of the java array (in the sense of the Comparable interface)-
Methods inherited from class RJavaArrayIterator
getArray, getArrayClassName, getDimensions, hasNext, next
-
-
-
-
Constructor Detail
-
RectangularArraySummary
public RectangularArraySummary(java.lang.Object array, int[] dimensions) throws NotAnArrayException, NotComparableException
Constructor- Parameters:
array
- the array to check- Throws:
NotAnArrayException
- if array is not an arrayNotComparableException
-
RectangularArraySummary
public RectangularArraySummary(java.lang.Object array, int length) throws NotAnArrayException, NotComparableException
-
-
Method Detail
-
min
public java.lang.Object min(boolean narm)
Iterates over the array to find the minimum value (in the sense of the Comparable interface)
-
max
public java.lang.Object max(boolean narm)
Iterates over the array to find the maximum value (in the sense of the Comparable interface)
-
range
public java.lang.Object[] range(boolean narm)
Iterates over the array to find the range of the java array (in the sense of the Comparable interface)
-
checkComparableObjects
public void checkComparableObjects() throws NotComparableException
- Throws:
NotComparableException
-
containsComparableObjects
public boolean containsComparableObjects()
-
-