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


Java Triple.getLeft方法代码示例

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


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

示例1: getLBUpperBound2

import org.apache.commons.lang3.tuple.Triple; //导入方法依赖的package包/类
public Pair<HashSet<ScoredAnnotation>, Integer> getLBUpperBound2(String query,
		HashSet<Annotation> goldStandardAnn, BindingGenerator bg, SmaphDebugger debugger)
				throws Exception {
	QueryInformation qi = getQueryInformation(query, debugger);
	List<Triple<HashSet<Annotation>, BindingFeaturePack, Double>> bindingToFtrsAndF1 = getLBBindingToFtrsAndF1(
			query, qi, goldStandardAnn, new StrongAnnotationMatch(
					wikiApi), qi.allCandidates(), debugger);
	HashSet<Annotation> bestBinding = null;
	double bestF1 = Double.NEGATIVE_INFINITY;
	for (Triple<HashSet<Annotation>, BindingFeaturePack, Double> bindingAndFtrsAndF1 : bindingToFtrsAndF1) {
		double f1 = bindingAndFtrsAndF1.getRight();
		if (f1 > bestF1) {
			bestBinding = bindingAndFtrsAndF1.getLeft();
			bestF1 = f1;
		}
	}

	HashSet<ScoredAnnotation> bestBindingScored = new HashSet<>();
	for (Annotation a: bestBinding)
		bestBindingScored.add(new ScoredAnnotation(a.getPosition(), a.getLength(), a.getConcept(), 1.0f));
	return new Pair<HashSet<ScoredAnnotation>, Integer>(bestBindingScored,
			bindingToFtrsAndF1.size());
}
 
开发者ID:marcocor,项目名称:smaph,代码行数:24,代码来源:SmaphAnnotator.java

示例2: getUpperBoundMentions

import org.apache.commons.lang3.tuple.Triple; //导入方法依赖的package包/类
public HashSet<ScoredAnnotation> getUpperBoundMentions(String query,
		HashSet<Annotation> goldStandardAnn, BindingGenerator bg, SmaphDebugger debugger)
				throws Exception {
	QueryInformation qi = getQueryInformation(query, debugger);
	List<Triple<HashSet<Annotation>, BindingFeaturePack, Double>> bindingToFtrsAndF1 = getLBBindingToFtrsAndF1(
			query, qi, goldStandardAnn,
			new StrongMentionAnnotationMatch(), qi.allCandidates(), debugger);
	HashSet<Annotation> bestBinding = null;
	double bestF1 = Double.NEGATIVE_INFINITY;
	for (Triple<HashSet<Annotation>, BindingFeaturePack, Double> bindingAndFtrsAndF1 : bindingToFtrsAndF1) {
		double f1 = bindingAndFtrsAndF1.getRight();
		if (f1 > bestF1) {
			bestBinding = bindingAndFtrsAndF1.getLeft();
			bestF1 = f1;
		}
	}

	if (bestBinding == null) return null;

	HashSet<ScoredAnnotation> bestBindingScored= new HashSet<>();
	for (Annotation a : bestBinding)
		bestBindingScored.add(new ScoredAnnotation(a.getPosition(), a.getLength(), a.getConcept(), 1.0f));
	return bestBindingScored;
}
 
开发者ID:marcocor,项目名称:smaph,代码行数:25,代码来源:SmaphAnnotator.java

示例3: processApplication

import org.apache.commons.lang3.tuple.Triple; //导入方法依赖的package包/类
private void processApplication(Map<String, Application> appCache,
                                Map.Entry<String, Pair<Set<GrpcHost>, Set<GrpcHost>>> entry) {
    Triple<String, String, String> appNameServiceVersion = getAppNameServiceVersion(entry.getKey());
    Pair<Set<GrpcHost>, Set<GrpcHost>> providerConsumer = entry.getValue();
    String appName = appNameServiceVersion.getLeft();
    String serviceName = appNameServiceVersion.getMiddle();
    String version = appNameServiceVersion.getRight();
    Application application = new Application(appName);
    GrpcService service = new GrpcService(appName, version, serviceName);
    if (providerConsumer.getLeft() != null) {
        service.addProviderHosts(providerConsumer.getLeft());
    }
    if (providerConsumer.getRight() != null) {
        service.addConsumerHosts(providerConsumer.getRight());
    }
    application.addService(service);
    if (appCache.get(application.getAppName()) == null) {
        appCache.put(application.getAppName(), application);
    } else {
        appCache.get(application.getAppName()).addServices(application.getServices());
    }
}
 
开发者ID:venus-boot,项目名称:saluki,代码行数:23,代码来源:ConsulRegistryService.java

示例4: run

import org.apache.commons.lang3.tuple.Triple; //导入方法依赖的package包/类
@Override
public Object run() {
    RequestContext ctx = RequestContext.getCurrentContext();
    HttpServletRequest request = ctx.getRequest();
    String auth = request.getHeader("Authorization");
    String accessToken = auth.split(" ")[1];
    ctx.set("LimitAccess", Boolean.TRUE);
    try {
        Triple<Long, String, Long> clientTriple = databaseUserDetailService.loadClientByToken(accessToken);
        String user = clientTriple.getMiddle();
        Long intervalInMills = clientTriple.getLeft();
        Long limits = clientTriple.getRight();
        if (intervalInMills != null && intervalInMills != 0l && limits != null && limits != 0l) {
            if (!access(user, intervalInMills, limits)) {
                ctx.set("LimitAccess", Boolean.FALSE);
                ctx.setSendZuulResponse(false);
                ctx.setResponseStatusCode(HttpServletResponse.SC_BAD_REQUEST);
                ctx.setResponseBody("The times of usage is limited");
            }
        }
    } catch (Throwable e) {
    }
    return null;
}
 
开发者ID:venus-boot,项目名称:saluki,代码行数:25,代码来源:LimitAccessFilter.java

示例5: setRelativeState

import org.apache.commons.lang3.tuple.Triple; //导入方法依赖的package包/类
private void setRelativeState(Triple<IBlockState, EnumFacing, NBTTagCompound> data) {
	BlockPos pos = getPos().offset(getFacingLazy());
	IBlockState state = data.getLeft();
	EnumFacing from = data.getMiddle();
	EnumFacing to = getFacingLazy();
	if(state.getBlock().canPlaceBlockAt(world, pos)) {
		world.setBlockState(pos, getRotationState(state, from, to));
		getTile(TileEntity.class, world, pos).ifPresent(tile -> {
			NBTTagCompound tag = data.getRight();
			tag.setInteger("x", pos.getX());
			tag.setInteger("y", pos.getY());
			tag.setInteger("z", pos.getZ());
			tile.readFromNBT(tag);
		});
	}
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:17,代码来源:TileMechanicalTranslocator.java

示例6: calculateURI

import org.apache.commons.lang3.tuple.Triple; //导入方法依赖的package包/类
public static Pair<RaptureURI, String> calculateURI(String leafTail) {
    String variant = (leafTail.startsWith(CONTENTDIR)) ? null : extractVariant(leafTail);
    Triple<String, String, Scheme> trip = extractScheme(leafTail.substring(variantLength(variant)));
    checkArgument(trip != null, "extraneuous file");
    RaptureURI uri = null;
    switch (trip.getRight()) {
    case USER:
    case ENTITLEMENTGROUP:
        if (trip.getLeft().indexOf("/") == -1) {
            uri = new RaptureURI(trip.getLeft(), trip.getRight());
        }
        break;
    default:
        break;
    }
    if (uri == null) {
        uri = RaptureURI.createFromFullPathWithAttribute(trip.getLeft(), trip.getMiddle(), trip.getRight());
    }
    return new ImmutablePair<RaptureURI, String>(uri, variant);
}
 
开发者ID:RapturePlatform,项目名称:Rapture,代码行数:21,代码来源:PluginSandboxItem.java

示例7: writeToParcel

import org.apache.commons.lang3.tuple.Triple; //导入方法依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(initPosition);
    dest.writeInt(shouldWaitForPageLoaded ? 1 : 0);
    dest.writeInt(attachments.size());
    for (Triple<AttachmentModel, String, String> tuple : attachments) {
        AttachmentModel attachment = tuple.getLeft();
        dest.writeInt(attachment.type);
        dest.writeInt(attachment.size);
        dest.writeString(attachment.thumbnail);
        dest.writeString(attachment.path);
        dest.writeInt(attachment.width);
        dest.writeInt(attachment.height);
        dest.writeString(attachment.originalName);
        dest.writeInt(attachment.isSpoiler ? 1 : 0);
        dest.writeString(tuple.getMiddle());
        dest.writeString(tuple.getRight());
    }
}
 
开发者ID:miku-nyan,项目名称:Overchan-Android,代码行数:20,代码来源:GalleryInitResult.java

示例8: testSetGetAttribute

import org.apache.commons.lang3.tuple.Triple; //导入方法依赖的package包/类
private void testSetGetAttribute(MBeanServerConnection connection, ObjectName name) throws Exception {
  for (Triple<String, String, String> pair : mbeanAttributes) {
    String attrName = pair.getLeft();
    String attrType = pair.getRight();
    Object attrValue;
    if (attrType.equals("int"))
      attrValue = RandomUtils.nextInt(30000, 65535);
    else if (attrType.equals("long"))
      attrValue = RandomUtils.nextLong(10, 1000);
    else
      attrValue = RandomStringUtils.randomAlphabetic(10);
    Attribute attr1 = new Attribute(attrName, attrValue);
    server.setAttribute(name, attr1);
    Object attr2 = server.getAttribute(name, attrName);
    assertEquals("Attribute values do not match", attrValue, attr2);
  }
}
 
开发者ID:magnetsystems,项目名称:message-server,代码行数:18,代码来源:MMXConfigurationTest.java

示例9: compare

import org.apache.commons.lang3.tuple.Triple; //导入方法依赖的package包/类
@Override
public int compare(Triple<Double, String[], Tag> o1,
		Triple<Double, String[], Tag> o2) {
	double diff = o1.getLeft() - o2.getLeft();
	if (diff < 0)
		return -1;
	else if (diff == 0)
		return 0;
	else
		return 1;
}
 
开发者ID:marcocor,项目名称:smaph,代码行数:12,代码来源:BaselineLinkBack.java

示例10: buildQueryCondition

import org.apache.commons.lang3.tuple.Triple; //导入方法依赖的package包/类
private Set<String> buildQueryCondition(String search, String dimension, Boolean accurate) {
    Set<String> beAboutToQuery = Sets.newHashSet();
    Map<String, Pair<Set<GrpcHost>, Set<GrpcHost>>> servicesPassing = registryRepository.getAllPassingService();
    for (Map.Entry<String, Pair<Set<GrpcHost>, Set<GrpcHost>>> entry : servicesPassing.entrySet()) {
        String serviceKey = entry.getKey();
        Triple<String, String, String> appNameServiceVersion = getAppNameServiceVersion(serviceKey);
        String appName = appNameServiceVersion.getLeft();
        String serviceName = appNameServiceVersion.getMiddle();
        if (dimension.equals("service")) {
            if (accurate) {
                if (StringUtils.equalsIgnoreCase(serviceName, search)) {
                    beAboutToQuery.add(serviceKey);
                }
            } else {
                if (StringUtils.containsIgnoreCase(serviceName, search)) {
                    beAboutToQuery.add(serviceKey);
                }
            }
        } else {
            if (accurate) {
                if (StringUtils.equalsIgnoreCase(appName, search)) {
                    beAboutToQuery.add(serviceKey);
                }
            } else {
                if (StringUtils.containsIgnoreCase(appName, search)) {
                    beAboutToQuery.add(serviceKey);
                }
            }
        }
    }
    return beAboutToQuery;
}
 
开发者ID:venus-boot,项目名称:saluki,代码行数:33,代码来源:ConsulRegistryService.java

示例11: buildQueryResponse

import org.apache.commons.lang3.tuple.Triple; //导入方法依赖的package包/类
private List<GrpcService> buildQueryResponse(Set<String> queryCondition, Boolean accurate) {
    List<GrpcService> services = Lists.newArrayList();
    Map<String, Pair<Set<GrpcHost>, Set<GrpcHost>>> servicesPassing = registryRepository.getAllPassingService();
    for (Iterator<String> it = queryCondition.iterator(); it.hasNext();) {
        String serviceKey = it.next();
        Triple<String, String, String> appNameServiceVersion = getAppNameServiceVersion(serviceKey);
        Pair<Set<GrpcHost>, Set<GrpcHost>> providerConsumer = servicesPassing.get(serviceKey);
        GrpcService service = new GrpcService(appNameServiceVersion.getLeft(), appNameServiceVersion.getRight(),
                                              appNameServiceVersion.getMiddle());
        service.setProviderHost(providerConsumer.getLeft());
        service.setConsumerHost(providerConsumer.getRight());
        services.add(service);
    }
    return services;
}
 
开发者ID:venus-boot,项目名称:saluki,代码行数:16,代码来源:ConsulRegistryService.java

示例12: genCheck

import org.apache.commons.lang3.tuple.Triple; //导入方法依赖的package包/类
private void genCheck()
{
    if(!full)
    {
        Pair<Matrix3f, Vector3f> pair = toAffine(matrix);
        Triple<Quat4f, Vector3f, Quat4f> triple = svdDecompose(pair.getLeft());
        this.translation = pair.getRight();
        this.leftRot = triple.getLeft();
        this.scale = triple.getMiddle();
        this.rightRot = triple.getRight();
        full = true;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:14,代码来源:TRSRTransformation.java

示例13: toDouble

import org.apache.commons.lang3.tuple.Triple; //导入方法依赖的package包/类
@Override
public double toDouble(Triple<Double, Double, Double> value) {
    switch (element) {
        case LEFT: return value.getLeft();
        case MIDDLE: return value.getMiddle();
        case RIGHT: return value.getRight();
    }
    throw new AssertionError(element);
}
 
开发者ID:ReplayMod,项目名称:ReplayStudio,代码行数:10,代码来源:PropertyParts.java

示例14: value

import org.apache.commons.lang3.tuple.Triple; //导入方法依赖的package包/类
void value(NodeMsg nodeMsg) {
    Triple<Long, String, Pair<Long, Serializable>> rKeyTsprimeVprime = (Triple<Long, String, Pair<Long, Serializable>>) nodeMsg.body;
    long r = rKeyTsprimeVprime.getLeft();
    String key = rKeyTsprimeVprime.getMiddle();
    Pair<Long, Serializable> tsprimeVprime = rKeyTsprimeVprime.getRight();
    //
    ridReadlist.get(r).put(nodeMsg.getSource(), tsprimeVprime);
    if (ridReadlist.get(r).size() > group.size() / 2) {
        Pair<Long, Serializable> maxtsReadval = highest(r);
        ridReadlist.get(r).clear();
        bcast(group, nodeMsg.rid, NodeMsg.WRITE, groupId, Triple.of(r, key, maxtsReadval));
    }
}
 
开发者ID:tobiajo,项目名称:jbstore,代码行数:14,代码来源:KVStore.java

示例15: write

import org.apache.commons.lang3.tuple.Triple; //导入方法依赖的package包/类
void write(NodeMsg nodeMsg) {
    Triple<Long, String, Pair<Long, Serializable>> rKeyTsprimeVprime = (Triple<Long, String, Pair<Long, Serializable>>) nodeMsg.body;
    long r = rKeyTsprimeVprime.getLeft();
    String key = rKeyTsprimeVprime.getMiddle();
    Pair<Long, Serializable> tsprimeVprime = rKeyTsprimeVprime.getRight();
    //
    if (keyTsVal.get(key) == null || tsprimeVprime.getLeft() > keyTsVal.get(key).getLeft()) {
        keyTsVal.put(key, tsprimeVprime);
    }
    send(nodeMsg.getSource(), nodeMsg.rid, NodeMsg.ACK, groupId, Pair.of(r, key));
}
 
开发者ID:tobiajo,项目名称:jbstore,代码行数:12,代码来源:KVStore.java


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