Example usage for org.apache.commons.lang3.tuple MutableTriple setMiddle

List of usage examples for org.apache.commons.lang3.tuple MutableTriple setMiddle

Introduction

In this page you can find the example usage for org.apache.commons.lang3.tuple MutableTriple setMiddle.

Prototype

public void setMiddle(final M middle) 

Source Link

Document

Sets the middle element of the triple.

Usage

From source file:com.artistech.tuio.mouse.MouseDriver.java

/**
 * Update Cursor Event./*from   w  w  w.j  av  a  2 s . c o m*/
 *
 * @param tcur
 */
@Override
public void updateTuioCursor(TuioCursor tcur) {
    logger.trace(MessageFormat.format("update tuio cursor id: {0}", tcur.getCursorID()));

    int width = (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth();
    int height = (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight();

    if (!curs.isEmpty() && curs.get(0).getLeft() == tcur.getSessionID()) {
        logger.debug(MessageFormat.format("update mouse move: ({0}, {1})",
                new Object[] { tcur.getScreenX(width), tcur.getScreenY(height) }));
        robot.mouseMove(tcur.getScreenX(width), tcur.getScreenY(height));
    }
    for (MutableTriple<Long, Integer, Integer> trip : curs) {
        if (trip.getLeft() == tcur.getSessionID()) {
            trip.setMiddle(tcur.getScreenX(width));
            trip.setRight(tcur.getScreenY(height));
            break;
        }
    }
}

From source file:be.shad.tsqb.test.SelectTests.java

@Test
public void selectNestedComponentTypeValues() {
    Product product = query.from(Product.class);

    @SuppressWarnings("unchecked")
    MutableTriple<String, String, Boolean> triple = query.select(MutableTriple.class);
    triple.setLeft(product.getName());//from   ww  w .jav  a  2 s  .  c o m
    triple.setMiddle(product.getProductProperties().getPlanning().getAlgorithm());
    triple.setRight(product.getProductProperties().getSales().isSalesAllowed());

    validate(
            "select hobj1.name as left, hobj1.productProperties.planning.algorithm as middle, hobj1.productProperties.sales.salesAllowed as right from Product hobj1");
}

From source file:be.shad.tsqb.test.SelectTests.java

@Test
public void selectMultiJoinedEntityValues() {
    Person person = query.from(Person.class);
    PersonProperty property1 = query.join(person.getProperties());
    PersonProperty property2 = query.join(person.getProperties(), JoinType.Inner, true);

    query.joinWith(property1).where(property1.getPropertyKey()).eq("FavoriteColor");
    query.joinWith(property2).where(property2.getPropertyKey()).eq("FavoriteDish");

    @SuppressWarnings("unchecked")
    MutableTriple<Long, String, Object> triple = query.select(MutableTriple.class);
    triple.setLeft(person.getId());/* w ww. ja  v  a 2 s  .co m*/
    triple.setMiddle(property1.getPropertyValue());
    triple.setRight(property2.getPropertyValue());

    validate(
            "select hobj1.id as left, hobj2.propertyValue as middle, hobj3.propertyValue as right "
                    + "from Person hobj1 " + "join hobj1.properties hobj2 with hobj2.propertyKey = :np1 "
                    + "join hobj1.properties hobj3 with hobj3.propertyKey = :np2",
            "FavoriteColor", "FavoriteDish");
}