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


Java CompareToBuilder.toComparison方法代码示例

本文整理汇总了Java中org.apache.commons.lang3.builder.CompareToBuilder.toComparison方法的典型用法代码示例。如果您正苦于以下问题:Java CompareToBuilder.toComparison方法的具体用法?Java CompareToBuilder.toComparison怎么用?Java CompareToBuilder.toComparison使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.lang3.builder.CompareToBuilder的用法示例。


在下文中一共展示了CompareToBuilder.toComparison方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: compareTo

import org.apache.commons.lang3.builder.CompareToBuilder; //导入方法依赖的package包/类
@Override
public int compareTo(AddressFamilyRoutingConfiguration o) {
	CompareToBuilder builder = (new CompareToBuilder())
			.append(getKey(), o.getKey())
			.append(getRoutes().size(), o.getRoutes().size());
	
	if(builder.toComparison() == 0) {
		Iterator<RouteConfiguration> lit = getRoutes().iterator();
		Iterator<RouteConfiguration> rit = o.getRoutes().iterator();
		
		while(lit.hasNext())
			builder.append(lit.next(), rit.next());
	}
	
	return builder.toComparison();
}
 
开发者ID:bnitin,项目名称:bgp-ls,代码行数:17,代码来源:AddressFamilyRoutingConfigurationImpl.java

示例2: compareTo

import org.apache.commons.lang3.builder.CompareToBuilder; //导入方法依赖的package包/类
@Override
public int compareTo(PathAttributeConfiguration o) {
	CompareToBuilder builder = new CompareToBuilder();
	
	builder.append(getAttributes().size(), o.getAttributes().size());
	
	if(builder.toComparison() == 0) {
		Iterator<PathAttribute> lit = getAttributes().iterator();
		Iterator<PathAttribute> rit = o.getAttributes().iterator();
		
		while(lit.hasNext())
			builder.append(lit.next(), rit.next());
	}
	
	return builder.toComparison();
}
 
开发者ID:bnitin,项目名称:bgp-ls,代码行数:17,代码来源:PathAttributeConfigurationImpl.java

示例3: compareToSubclass

import org.apache.commons.lang3.builder.CompareToBuilder; //导入方法依赖的package包/类
@Override
protected int compareToSubclass(Capability other) {
	OutboundRouteFilteringCapability orc = (OutboundRouteFilteringCapability)other;
	CompareToBuilder builder = new CompareToBuilder();
	
	builder.append(getAddressFamily(), orc.getAddressFamily())
		.append(getSubsequentAddressFamily(), orc.getSubsequentAddressFamily())
		.append(getFilters().size(), orc.getFilters()
				.size());
	
	if(builder.toComparison() != 0)
		return builder.toComparison();

	Iterator<ORFType> hSet = getFilters().keySet().iterator();
	Iterator<ORFType> oSet = orc.getFilters().keySet().iterator();
	
	while(hSet.hasNext()) {
		ORFType hType = hSet.next();
		ORFType oType = oSet.next();
		
		builder.append(hType, oType).append(getFilters().get(hType), orc.getFilters().get(oType));
	}
	
	return builder.toComparison();
}
 
开发者ID:bnitin,项目名称:bgp-ls,代码行数:26,代码来源:OutboundRouteFilteringCapability.java

示例4: subclassCompareTo

import org.apache.commons.lang3.builder.CompareToBuilder; //导入方法依赖的package包/类
@Override
protected int subclassCompareTo(PathAttribute obj) {
	ASPathAttribute o = (ASPathAttribute)obj;

	CompareToBuilder builder = (new CompareToBuilder())
			.append(getAsType(), o.getAsType())
			.append(getPathSegments().size(), o.getPathSegments().size());
	
	if(builder.toComparison() == 0) {
		Iterator<PathSegment> lit = getPathSegments().iterator();
		Iterator<PathSegment> rit = o.getPathSegments().iterator();
		
		while(lit.hasNext())
			builder.append(lit.next(), rit.next());
	}
	
	return builder.toComparison();
}
 
开发者ID:bnitin,项目名称:bgp-ls,代码行数:19,代码来源:ASPathAttribute.java

示例5: subclassCompareTo

import org.apache.commons.lang3.builder.CompareToBuilder; //导入方法依赖的package包/类
@Override
protected int subclassCompareTo(PathAttribute obj) {
	MultiProtocolNLRI o = (MultiProtocolNLRI)obj;
	
	CompareToBuilder builer = (new CompareToBuilder())
			.append(getPathAttributeType(), o.getPathAttributeType())
			.append(getAddressFamily(), o.getAddressFamily())
			.append(getSubsequentAddressFamily(), o.getSubsequentAddressFamily())
			.append(getNextHop(), o.getNextHop())
			.append(getNlris().size(), o.getNlris().size());
	
	if(builer.toComparison() == 0) {
		Iterator<MultiProtocolNLRIInformation> lit = getNlris().iterator();
		Iterator<MultiProtocolNLRIInformation> rit = o.getNlris().iterator();
		
		while(lit.hasNext())
			builer.append(lit.next(), rit.next());
	}
	
	return builer.toComparison();
}
 
开发者ID:bnitin,项目名称:bgp-ls,代码行数:22,代码来源:MultiProtocolNLRI.java

示例6: subclassCompareTo

import org.apache.commons.lang3.builder.CompareToBuilder; //导入方法依赖的package包/类
@Override
protected int subclassCompareTo(PathAttribute obj) {
	CommunityPathAttribute o = (CommunityPathAttribute)obj;
	CompareToBuilder builder = (new CompareToBuilder())
		.append(getCommunity(), o.getCommunity())
		.append(getMembers().size(), o.getMembers().size());
	
	if(builder.toComparison() == 0) {
		Iterator<CommunityMember> lit = getMembers().iterator();
		Iterator<CommunityMember> rit = o.getMembers().iterator();
		
		while(lit.hasNext())
			builder.append(lit.next(), rit.next());
	}
	
	return builder.toComparison();
}
 
开发者ID:bnitin,项目名称:bgp-ls,代码行数:18,代码来源:CommunityPathAttribute.java

示例7: subclassCompareTo

import org.apache.commons.lang3.builder.CompareToBuilder; //导入方法依赖的package包/类
@Override
protected int subclassCompareTo(PathAttribute obj) {
	CompareToBuilder builder = new CompareToBuilder();
	ClusterListPathAttribute o = (ClusterListPathAttribute)obj;
	
	builder.append(getClusterIds().size(), o.getClusterIds().size());
	
	if(builder.toComparison() == 0) {
		Iterator<Integer> lit = getClusterIds().iterator();
		Iterator<Integer> rit = o.getClusterIds().iterator();
		
		while(lit.hasNext())
			builder.append(lit.next(), rit.next());
	}
	
	return builder.toComparison();
}
 
开发者ID:bnitin,项目名称:bgp-ls,代码行数:18,代码来源:ClusterListPathAttribute.java

示例8: compareTo

import org.apache.commons.lang3.builder.CompareToBuilder; //导入方法依赖的package包/类
@Override
public int compareTo(PathSegment o) {
	CompareToBuilder builder = (new CompareToBuilder())
			.append(getAsType(), o.getAsType())
			.append(getPathSegmentType(), o.getPathSegmentType())
			.append(getAses().size(), o.getAses().size());
	
	if(builder.toComparison() == 0) {
		Iterator<Integer> lit = getAses().iterator();
		Iterator<Integer> rit = o.getAses().iterator();
		
		while(lit.hasNext())
			builder.append(lit.next(), rit.next());
	}
	
	return builder.toComparison();
}
 
开发者ID:bnitin,项目名称:bgp-ls,代码行数:18,代码来源:PathSegment.java

示例9: compareTo

import org.apache.commons.lang3.builder.CompareToBuilder; //导入方法依赖的package包/类
@Override
public int compareTo(final Package o) {
    final CompareToBuilder builder = new CompareToBuilder();
    builder.append(this.getGroup(), o.getGroup())
           .append(this.getName(), o.getName())
           .append(this.getId(), o.getId());

    return builder.toComparison();
}
 
开发者ID:joyent,项目名称:java-triton,代码行数:10,代码来源:Package.java

示例10: compareTo

import org.apache.commons.lang3.builder.CompareToBuilder; //导入方法依赖的package包/类
@Override
public int compareTo(Period o) {
	CompareToBuilder cmpBuilder = new CompareToBuilder();
	cmpBuilder.append(this.getBeginDate(), o.getBeginDate());
	cmpBuilder.append(this.getEndDate(), o.getEndDate());
	return cmpBuilder.toComparison();
}
 
开发者ID:CIT-VSB-TUO,项目名称:ResBill,代码行数:8,代码来源:Period.java

示例11: compare

import org.apache.commons.lang3.builder.CompareToBuilder; //导入方法依赖的package包/类
@Override
public int compare(TermFrequency term1, TermFrequency term2) {
    // compute for descending frequency order
    CompareToBuilder builder = new CompareToBuilder();
    builder.append(term2.frequency, term1.frequency);

    // compute for descending word-count order
    builder.append(term2.wordCount, term1.wordCount);

    // and finally sort by the term, alphabetically, ascending.
    builder.append(term1.term, term2.term);
    return builder.toComparison();
}
 
开发者ID:jhaood,项目名称:github-job-keywords,代码行数:14,代码来源:TermFrequency.java

示例12: compareTo

import org.apache.commons.lang3.builder.CompareToBuilder; //导入方法依赖的package包/类
@Override
public int compareTo(final Entry<T> o) {
    final CompareToBuilder b = new CompareToBuilder();
    b.append(-this.count, -o.count);
    b.append(this.value, o.value);
    return b.toComparison();
}
 
开发者ID:Zuehlke,项目名称:SHMACK,代码行数:8,代码来源:SortedCounts.java

示例13: compareTo

import org.apache.commons.lang3.builder.CompareToBuilder; //导入方法依赖的package包/类
@Override
public int compareTo(UserRole o) {
	CompareToBuilder builder = new CompareToBuilder();
	builder.append(getRoleId(), o.getRoleId());
	builder.append(getUserId(), o.getUserId());
	return builder.toComparison();
}
 
开发者ID:SmarterApp,项目名称:TechnologyReadinessTool,代码行数:8,代码来源:UserRole.java

示例14: compareTo

import org.apache.commons.lang3.builder.CompareToBuilder; //导入方法依赖的package包/类
@Override
public int compareTo(RoutingProcessorConfiguration o) {
	CompareToBuilder builder = (new CompareToBuilder())
			.append(getRoutingInstances().size(), o.getRoutingInstances().size());
	
	if(builder.toComparison() == 0) {
		Iterator<RoutingInstanceConfiguration> lit = getRoutingInstances().iterator();
		Iterator<RoutingInstanceConfiguration> rit = o.getRoutingInstances().iterator();
		
		while(lit.hasNext())
			builder.append(lit.next(), rit.next());
	}

	return builder.toComparison();
}
 
开发者ID:bnitin,项目名称:bgp-ls,代码行数:16,代码来源:RoutingProcessorConfigurationImpl.java

示例15: compareTo

import org.apache.commons.lang3.builder.CompareToBuilder; //导入方法依赖的package包/类
@Override
public int compareTo(RoutingConfiguration o) {
	CompareToBuilder builder = (new CompareToBuilder())
			.append(getRoutingConfigurations().size(), o.getRoutingConfigurations().size());
	
	if(builder.toComparison() == 0) {
		Iterator<AddressFamilyRoutingConfiguration> lit = getRoutingConfigurations().iterator();
		Iterator<AddressFamilyRoutingConfiguration> rit = o.getRoutingConfigurations().iterator();
		
		while(lit.hasNext())
			builder.append(lit.next(), rit.next());
	}
	
	return builder.toComparison();
}
 
开发者ID:bnitin,项目名称:bgp-ls,代码行数:16,代码来源:RoutingConfigurationImpl.java


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