Java 类org.apache.commons.collections.comparators.NullComparator 实例源码

项目:eMonocot    文件:ReferenceComparator.java   
public ReferenceComparator() {
    Comparator<String> stringComparator = new Comparator<String>() {

        @Override
        public int compare(String o1, String o2) {
            return o1.compareTo(o2);
        }

    };
    nullSafeStringComparator = new NullComparator(stringComparator, false);
}
项目:egd-web    文件:JCComparator.java   
public static <T> Comparator<T> getComparator(String columnName, boolean reverse) {
    Comparator<T> c;
    if (reverse) {
        c = Collections.reverseOrder(new BeanComparator<T>(columnName, new NullComparator(false)));
    } else {
        c = new BeanComparator<T>(columnName, new NullComparator(false));
    }
    return c;
}
项目:sakai    文件:CalculatedQuestionBean.java   
/**
 * getFormulasList returns a List of all formulas, sorted by formula name
 * @return
 */
public List<CalculatedQuestionFormulaBean> getFormulasList() {
    List<CalculatedQuestionFormulaBean> beanList = new ArrayList<CalculatedQuestionFormulaBean>(formulas.values());
    Collections.sort(beanList, new Comparator<CalculatedQuestionFormulaBean>() {
        public int compare(CalculatedQuestionFormulaBean bean1, CalculatedQuestionFormulaBean bean2) {
            return new NullComparator().compare(bean1.getName(), bean2.getName());
        }
    });
    return beanList;
}
项目:sakai    文件:CalculatedQuestionBean.java   
/**
 * getVariablesList returns a List of all variables, sorted by variable name
 * @return
 */
public List<CalculatedQuestionVariableBean> getVariablesList() {
    List<CalculatedQuestionVariableBean> beanList = new ArrayList<CalculatedQuestionVariableBean>(variables.values());
    Collections.sort(beanList, new Comparator<CalculatedQuestionVariableBean>() {
        public int compare(CalculatedQuestionVariableBean bean1, CalculatedQuestionVariableBean bean2) {
            return new NullComparator().compare(bean1.getName(), bean2.getName());
        }
    });
    return beanList;
}
项目:telekom-workflow-engine    文件:WorkflowInstancesListController.java   
protected List<WorkflowInstanceSearchModel> sortSearchResult( List<WorkflowInstanceSearchModel> result, int column, String direction ){
    List<WorkflowInstanceSearchModel> unorderedSource = new ArrayList<>( result );
    String fieldName = DataTableColumnMapper.from( column ).getFieldName();
    BeanComparator<WorkflowInstanceSearchModel> beanComparator;
    if( "asc".equalsIgnoreCase( direction ) ){
        beanComparator = new BeanComparator<>( fieldName, new NullComparator() );
    }
    else{
        beanComparator = new BeanComparator<>( fieldName, new ReverseComparator( new NullComparator() ) );
    }
    Collections.sort( unorderedSource, beanComparator );
    return unorderedSource;
}
项目:sakai    文件:CalculatedQuestionBean.java   
/**
 * getFormulasList returns a List of all formulas, sorted by formula name
 * @return
 */
public List<CalculatedQuestionFormulaBean> getFormulasList() {
    List<CalculatedQuestionFormulaBean> beanList = new ArrayList<CalculatedQuestionFormulaBean>(formulas.values());
    Collections.sort(beanList, new Comparator<CalculatedQuestionFormulaBean>() {
        public int compare(CalculatedQuestionFormulaBean bean1, CalculatedQuestionFormulaBean bean2) {
            return new NullComparator().compare(bean1.getName(), bean2.getName());
        }
    });
    return beanList;
}
项目:sakai    文件:CalculatedQuestionBean.java   
/**
 * getVariablesList returns a List of all variables, sorted by variable name
 * @return
 */
public List<CalculatedQuestionVariableBean> getVariablesList() {
    List<CalculatedQuestionVariableBean> beanList = new ArrayList<CalculatedQuestionVariableBean>(variables.values());
    Collections.sort(beanList, new Comparator<CalculatedQuestionVariableBean>() {
        public int compare(CalculatedQuestionVariableBean bean1, CalculatedQuestionVariableBean bean2) {
            return new NullComparator().compare(bean1.getName(), bean2.getName());
        }
    });
    return beanList;
}
项目:viritin    文件:ListContainer.java   
/**
 *
 * Override point. Allows user to use custom comparators based on
 * properties.
 *
 * @param property the property whose comparator is requested
 * @return Comparator that will compare two objects based on a property
 */
protected Comparator<?> getUnderlyingComparator(Object property) {
    return new NullComparator();
}
项目:extacrm    文件:NListContainer.java   
/**
 * Override point. Allows user to use custom comparators based on properties.
 *
 * @param property the property whose comparator is requested
 * @return Comparator that will compare two objects based on a property
 */
protected Comparator<T> getUnderlyingComparator(final Object property) {
    return new NullComparator();
}