Fixing package names so things compile. Removing Boolean and Transform usages in ComparatorUtils as those classes didn't come accross
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1154833 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6f279ce78b
commit
9c96f2a222
|
@ -14,7 +14,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.commons.collections.comparators;
|
||||
package org.apache.commons.lang3.compare;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Comparator;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.commons.collections.comparators;
|
||||
package org.apache.commons.lang3.compare;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -14,18 +14,11 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.commons.collections;
|
||||
package org.apache.commons.lang3.compare;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
|
||||
import org.apache.commons.collections.comparators.BooleanComparator;
|
||||
import org.apache.commons.collections.comparators.ComparableComparator;
|
||||
import org.apache.commons.collections.comparators.ComparatorChain;
|
||||
import org.apache.commons.collections.comparators.NullComparator;
|
||||
import org.apache.commons.collections.comparators.ReverseComparator;
|
||||
import org.apache.commons.collections.comparators.TransformingComparator;
|
||||
|
||||
/**
|
||||
* Provides convenient static utility methods for <Code>Comparator</Code>
|
||||
* objects.
|
||||
|
@ -132,22 +125,6 @@ public class ComparatorUtils {
|
|||
return new ReverseComparator<E>(comparator);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a Comparator that can sort Boolean objects.
|
||||
* <p>
|
||||
* The parameter specifies whether true or false is sorted first.
|
||||
* <p>
|
||||
* The comparator throws NullPointerException if a null value is compared.
|
||||
*
|
||||
* @param trueFirst when <code>true</code>, sort
|
||||
* <code>true</code> {@link Boolean}s before
|
||||
* <code>false</code> {@link Boolean}s.
|
||||
* @return a comparator that sorts booleans
|
||||
*/
|
||||
public static Comparator<Boolean> booleanComparator(boolean trueFirst) {
|
||||
return BooleanComparator.booleanComparator(trueFirst);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a Comparator that controls the comparison of <code>null</code> values.
|
||||
* <p>
|
||||
|
@ -186,26 +163,6 @@ public class ComparatorUtils {
|
|||
return new NullComparator<E>(comparator, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a Comparator that passes transformed objects to the given comparator.
|
||||
* <p>
|
||||
* Objects passed to the returned comparator will first be transformed
|
||||
* by the given transformer before they are compared by the given
|
||||
* comparator.
|
||||
*
|
||||
* @param comparator the sort order to use
|
||||
* @param transformer the transformer to use
|
||||
* @return a comparator that transforms its input objects before comparing them
|
||||
* @see TransformingComparator
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <E> Comparator<E> transformedComparator(Comparator<E> comparator, Transformer<? super E, ? extends E> transformer) {
|
||||
if (comparator == null) {
|
||||
comparator = NATURAL_COMPARATOR;
|
||||
}
|
||||
return new TransformingComparator<E>(transformer, comparator);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the smaller of the given objects according to the given
|
||||
* comparator, returning the second object if the comparator
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.commons.collections.comparators;
|
||||
package org.apache.commons.lang3.compare;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
|
|
|
@ -14,13 +14,11 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.commons.collections.comparators;
|
||||
package org.apache.commons.lang3.compare;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Comparator;
|
||||
|
||||
import org.apache.commons.collections.ComparatorUtils;
|
||||
|
||||
/**
|
||||
* A Comparator that will compare nulls to be either lower or higher than
|
||||
* other objects.
|
||||
|
|
|
@ -14,13 +14,11 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.commons.collections.comparators;
|
||||
package org.apache.commons.lang3.compare;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Comparator;
|
||||
|
||||
import org.apache.commons.collections.ComparatorUtils;
|
||||
|
||||
/**
|
||||
* Reverses the order of another comparator by reversing the arguments
|
||||
* to its {@link #compare(Object, Object) compare} method.
|
||||
|
|
Loading…
Reference in New Issue