當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。