summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2008-05-14 23:46:11 +0000
committerBrian S. O'Neill <bronee@gmail.com>2008-05-14 23:46:11 +0000
commit2dc31dcd188d031a6704a613decee88b074aad8f (patch)
treef5c05c6d6eaa7dee7c063b7980612013a8e950f6 /src/main/java
parent0c32c3144d64c217c1065326a8990b75234c5c5f (diff)
Moved utility comparators to util package.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/amazon/carbonado/cursor/SortedCursor.java2
-rw-r--r--src/main/java/com/amazon/carbonado/util/Comparators.java (renamed from src/main/java/com/amazon/carbonado/cursor/Comparators.java)6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/com/amazon/carbonado/cursor/SortedCursor.java b/src/main/java/com/amazon/carbonado/cursor/SortedCursor.java
index e4e7b68..8de527d 100644
--- a/src/main/java/com/amazon/carbonado/cursor/SortedCursor.java
+++ b/src/main/java/com/amazon/carbonado/cursor/SortedCursor.java
@@ -42,6 +42,8 @@ import com.amazon.carbonado.info.OrderedProperty;
import com.amazon.carbonado.info.StorableInfo;
import com.amazon.carbonado.info.StorableIntrospector;
+import com.amazon.carbonado.util.Comparators;
+
/**
* Wraps another Cursor and ensures the results are sorted. If the elements in
* the source cursor are already partially sorted, a handled comparator can be
diff --git a/src/main/java/com/amazon/carbonado/cursor/Comparators.java b/src/main/java/com/amazon/carbonado/util/Comparators.java
index bddd883..c3ba418 100644
--- a/src/main/java/com/amazon/carbonado/cursor/Comparators.java
+++ b/src/main/java/com/amazon/carbonado/util/Comparators.java
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package com.amazon.carbonado.cursor;
+package com.amazon.carbonado.util;
import java.util.Comparator;
@@ -27,7 +27,7 @@ import org.cojen.classfile.TypeDesc;
*
* @author Brian S O'Neill
*/
-class Comparators {
+public class Comparators {
/**
* Returns a comparator which can sort single or multi-dimensional arrays
* of primitves or Comparables.
@@ -35,7 +35,7 @@ class Comparators {
* @param unsigned applicable only to arrays of bytes, shorts, ints, or longs
* @return null if unsupported
*/
- static <T> Comparator<T> arrayComparator(Class<T> arrayType, boolean unsigned) {
+ public static <T> Comparator<T> arrayComparator(Class<T> arrayType, boolean unsigned) {
if (!arrayType.isArray()) {
throw new IllegalArgumentException();
}