added separate methods for setting/changing sort order on a Comparator

in the chain


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130631 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Morgan James Delagrange 2002-03-01 23:40:43 +00:00
parent 21c62eb49c
commit c55fe26ab9
1 changed files with 13 additions and 3 deletions

View File

@ -1,7 +1,7 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/comparators/ComparatorChain.java,v 1.1 2002/03/01 23:29:24 morgand Exp $
* $Revision: 1.1 $
* $Date: 2002/03/01 23:29:24 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/comparators/ComparatorChain.java,v 1.2 2002/03/01 23:40:43 morgand Exp $
* $Revision: 1.2 $
* $Date: 2002/03/01 23:40:43 $
*
* ====================================================================
*
@ -166,6 +166,16 @@ public class ComparatorChain implements Comparator,Serializable {
}
}
public void setForwardSort(int index) {
checkLocked();
orderingBits.clear(index);
}
public void setReverseSort(int index) {
checkLocked();
orderingBits.set(index);
}
public void checkLocked() {
if (isLocked == true) {
throw new UnsupportedOperationException("Comparator ordering cannot be changed after the first comparison is performed");