|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.paperclips.internal.PaperClipsUtil
public class PaperClipsUtil
Convenience methods specific to PaperClips
| Method Summary | |
|---|---|
static int[] |
copy(int[] array)
Returns a copy of the array. |
static int[][] |
copy(int[][] array)
Returns a deep copy of the array. |
static void |
dispose(java.util.List pages)
Disposes the print pieces in the list. |
static void |
dispose(PrintPiece piece)
Disposes the print piece if not null. |
static void |
dispose(PrintPiece[] pieces)
Disposes the print pieces that are not null. |
static void |
dispose(PrintPiece[] pages,
int start,
int end)
Disposes the print pieces in the array from start (inclusive) to end (exclusive). |
static void |
dispose(PrintPiece p1,
PrintPiece p2)
Disposes the arguments that are not null. |
static void |
dispose(PrintPiece piece,
PrintPiece[] pieces)
Disposes the print pieces that are not null. |
static int |
firstMatch(int value,
int[] masks,
int defaultMask)
Returns the first element in masks where (value & mask[index]) == mask[index]. |
static int |
sum(int[] array)
Returns the sum of all elements in the array. |
static int |
sum(int[] array,
int start,
int count)
Returns the sum of all elements in the array in the range [start, start+count). |
static int |
sumByIndex(int[] array,
int[] indices)
Returns the sum of all elements in the array at the given indices. |
static int[] |
toIntArray(java.util.List list)
Converts the argument to an int[] array. |
static int[][] |
toIntIntArray(java.util.List list)
Converts the argument to an int[][] array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void dispose(PrintPiece piece)
piece - the print piece to dispose.
public static void dispose(PrintPiece p1,
PrintPiece p2)
p1 - print piece to disposep2 - print piece to disposepublic static void dispose(PrintPiece[] pieces)
pieces - array of print pieces to dispose.
public static void dispose(PrintPiece[] pages,
int start,
int end)
pages - array of print pieces to dispose.start - the start index.end - the end index.public static void dispose(java.util.List pages)
pages - list of print pieces to dispose.
public static void dispose(PrintPiece piece,
PrintPiece[] pieces)
piece - a print piece to disposepieces - array of print pieces to disposepublic static int[] copy(int[] array)
array - the array to copy
public static int[][] copy(int[][] array)
array - the array to copy
public static int sum(int[] array)
array - the array
public static int sum(int[] array,
int start,
int count)
[start, start+count).
array - the array containing the elements to add up.start - the index of the first element to add.count - the number of elements to add.
public static int sumByIndex(int[] array,
int[] indices)
array - the array of elements to add up.indices - the indices of the elements in the array to add up.
public static int[] toIntArray(java.util.List list)
list - a List of Integers.
public static int[][] toIntIntArray(java.util.List list)
list - a List of int[] arrays.
public static int firstMatch(int value,
int[] masks,
int defaultMask)
value - the value to matchmasks - the possible values.defaultMask - the value to return if no match is found.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||