Arrays Class Reference

#include <coherence/util/Arrays.hpp>

List of all members.


Detailed Description

This class contains various methods for manipulating arrays (such as sorting and searching).

Author:
tb 2008.04.04

Static Public Member Functions

static void sort (ObjectArray::Handle hArray)
 Sorts the specified array of objects into ascending order, according to the natural ordering of its elements.
static void sort (ObjectArray::Handle hArray, Comparator::Handle hComparator)
 Sorts the specified array of objects according to the order induced by the specified comparator.

Member Function Documentation

static void sort ( ObjectArray::Handle  hArray  )  [static]

Sorts the specified array of objects into ascending order, according to the natural ordering of its elements.

All elements in the array must implement the Comparable interface. Furthermore, all elements in the array must be mutually comparable.

This sort is guaranteed to be stable: equal elements will not be reordered as a result of the sort.

Parameters:
hArray the array to be sorted
Exceptions:
ClassCastException if the array contains elements that are not mutually comparable

static void sort ( ObjectArray::Handle  hArray,
Comparator::Handle  hComparator 
) [static]

Sorts the specified array of objects according to the order induced by the specified comparator.

All elements in the array must be mutually comparable by the specified comparator.

This sort is guaranteed to be stable: equal elements will not be reordered as a result of the sort.

Parameters:
hArray the array to be sorted
hComparator the comparator to determine the order of the array. A null value indicates that the elements' natural ordering should be used
Exceptions:
ClassCastException if the array contains elements that are not mutually comparable


The documentation for this class was generated from the following file: Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.