本文整理匯總了Java中org.apache.commons.lang3.tuple.Triple.getRight方法的典型用法代碼示例。如果您正苦於以下問題:Java Triple.getRight方法的具體用法?Java Triple.getRight怎麽用?Java Triple.getRight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.lang3.tuple.Triple
的用法示例。
在下文中一共展示了Triple.getRight方法的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());
}
示例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;
}
示例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());
}
}
示例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;
}
示例5: 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);
}
示例6: showGraph
import org.apache.commons.lang3.tuple.Triple; //導入方法依賴的package包/類
private void showGraph(Graph g, List<Vector3f> positions) {
ArrayList<Vector3f> lines = new ArrayList<>();
ArrayList<ColorRGBA> colors = new ArrayList<>();
for (Triple<Integer, Integer, Float> e : g) {
lines.add(positions.get(e.getLeft()));
lines.add(positions.get(e.getMiddle()));
float v = 1 - (e.getRight()+100)/200f;
ColorRGBA col = new ColorRGBA(1, v, v, 1);
// ColorRGBA col = ColorRGBA.White;
colors.add(col);
colors.add(col);
}
Mesh m = new Mesh();
m.setBuffer(VertexBuffer.Type.Position, 3, BufferUtils.createFloatBuffer(lines.toArray(new Vector3f[lines.size()])));
m.setBuffer(VertexBuffer.Type.Color, 4, BufferUtils.createFloatBuffer(colors.toArray(new ColorRGBA[colors.size()])));
m.setMode(Mesh.Mode.Lines);
m.setLineWidth(2);
m.updateCounts();
m.updateBound();
Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
//mat.setColor("Color", ColorRGBA.White);
mat.setBoolean("VertexColor", true);
Geometry geom = new Geometry("graph", m);
geom.setMaterial(mat);
featureNode.attachChild(geom);
}
示例7: itemCustomParamSql
import org.apache.commons.lang3.tuple.Triple; //導入方法依賴的package包/類
private static void itemCustomParamSql(List<Object> params, StringBuilder where_sql,
List<Triple<String, Condition, Object>> custom_params,
boolean append_and) {
for (Triple<String, Condition, Object> custom_param : custom_params) {
if (append_and) {
where_sql.append(" AND ");
}
where_sql.append(custom_param.getLeft());
final Condition con = custom_param.getMiddle();
where_sql.append(con.condition);
switch (con) {
case BETWEEN:
final Object[] value2 = (Object[]) custom_param.getRight();
params.add(value2[0]);
params.add(value2[1]);
break;
default:
params.add(custom_param.getRight());
break;
}
append_and = true;
}
}
示例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);
}
}
示例9: 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;
}
示例10: 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;
}
}
示例11: 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);
}
示例12: getSpriteForVertexIndex
import org.apache.commons.lang3.tuple.Triple; //導入方法依賴的package包/類
/**
* Retrieves a TextureAtlasSprite from the internal map based on a vertex index.
*
* @param index The vertex index.
* @return Returns the Icon, Null if no transform for the vertex index.
*/
public TextureAtlasSprite getSpriteForVertexIndex(int index) {
for (Triple<Integer, Integer, TextureAtlasSprite> entry : transformMap) {
if (MathHelper.between(entry.getLeft(), index, entry.getMiddle())) {
return entry.getRight();
}
}
return null;
}
示例13: toString
import org.apache.commons.lang3.tuple.Triple; //導入方法依賴的package包/類
/**
*
* @return
*/
public final String toString(String delimiter) {
StringBuilder builder = new StringBuilder();
/* Create header. */
builder.append("ID");
builder.append(delimiter);
builder.append("Hit");
builder.append(delimiter);
builder.append("Precision");
builder.append(delimiter);
builder.append("Recall");
builder.append("\n");
int i = 0;
/* Append data. */
for (Triple<String,Float,Float> triple : this.pk) {
builder.append(triple.getLeft());
builder.append(delimiter);
/* Check if entry was a documentAvailable. */
boolean hit = false;
if (i == 0 && triple.getRight() > 0) {
hit = true;
} else if (i > 0 && triple.getRight() > this.pk.get(i-1).getRight()) {
hit = true;
}
builder.append(hit ? 1 : 0);
builder.append(delimiter);
builder.append(triple.getMiddle());
builder.append(delimiter);
builder.append(triple.getRight());
builder.append("\n");
i++;
}
return builder.toString();
}
示例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));
}
}
示例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));
}