当前位置: 首页>>代码示例>>Java>>正文


Java NullComparator类代码示例

本文整理汇总了Java中org.apache.commons.collections.comparators.NullComparator的典型用法代码示例。如果您正苦于以下问题:Java NullComparator类的具体用法?Java NullComparator怎么用?Java NullComparator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NullComparator类属于org.apache.commons.collections.comparators包,在下文中一共展示了NullComparator类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ReferenceComparator

import org.apache.commons.collections.comparators.NullComparator; //导入依赖的package包/类
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);
}
 
开发者ID:RBGKew,项目名称:eMonocot,代码行数:12,代码来源:ReferenceComparator.java

示例2: getComparator

import org.apache.commons.collections.comparators.NullComparator; //导入依赖的package包/类
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;
}
 
开发者ID:esutoniagodesu,项目名称:egd-web,代码行数:10,代码来源:JCComparator.java

示例3: getFormulasList

import org.apache.commons.collections.comparators.NullComparator; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:14,代码来源:CalculatedQuestionBean.java

示例4: getVariablesList

import org.apache.commons.collections.comparators.NullComparator; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:14,代码来源:CalculatedQuestionBean.java

示例5: sortSearchResult

import org.apache.commons.collections.comparators.NullComparator; //导入依赖的package包/类
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;
}
 
开发者ID:zutnop,项目名称:telekom-workflow-engine,代码行数:14,代码来源:WorkflowInstancesListController.java

示例6: getUnderlyingComparator

import org.apache.commons.collections.comparators.NullComparator; //导入依赖的package包/类
/**
 *
 * 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();
}
 
开发者ID:viritin,项目名称:viritin,代码行数:12,代码来源:ListContainer.java

示例7: getUnderlyingComparator

import org.apache.commons.collections.comparators.NullComparator; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:10,代码来源:NListContainer.java


注:本文中的org.apache.commons.collections.comparators.NullComparator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。