Examples of PathExpression


Examples of com.google.devtools.depan.filters.PathExpression

   * @param isRecursive Shows whether the selected relations should be applied
   * recursively.
   */
  public void createPathMatcherModel(boolean isRecursive) {
    String setName = getSelectedRelationshipSet().getName();
    PathExpression pathExpressionModel = new PathExpression();
    RelationshipSetAdapter setAdapterFromPicker =
        new RelationshipSetAdapter(setName, getRelationShips(),
            SourcePluginRegistry.getRelations());
    pathExpressionModel.addPathMatcher(
        new PathMatcherTerm(setAdapterFromPicker, isRecursive, false));
    pathMatcherModel = pathExpressionModel;
  }
View Full Code Here

Examples of com.google.devtools.depan.filters.PathExpression

  }

  // TODO(leeca): rename PathMatcher class to NodeSelector
  @Override
  public PathMatcher getNodeSelector() {
    PathExpression result = new PathExpression();
    for (int i = 0; i < pathMatchers.getTable().getItemCount(); i++) {
      PathMatcherTerm matchers =
          (PathMatcherTerm) pathMatchers.getElementAt(i);
      result.addPathMatcher(matchers);
    }
    return result;
  }
View Full Code Here

Examples of com.google.devtools.depan.filters.PathExpression

  /**
   * Creates the <code>PathExpression</code> object used internally for
   * filtering nodes.
   */
  public void createPathMatcherModel() {
    pathExpression = new PathExpression();
    PathExpression pathExpressionRef = (PathExpression) pathExpression;
    for (int i = 0; i < pathMatchers.getTable().getItemCount(); i++) {
      PathMatcherTerm matchers =
          (PathMatcherTerm) pathMatchers.getElementAt(i);
      pathExpressionRef.addPathMatcher(matchers);
    }
  }
View Full Code Here

Examples of lv.odylab.evemanage.client.rpc.PathExpression

    @Test
    public void testBuild() {
        CalculationDto calculation = new CalculationDto();
        CalculationItemDto calculationItem1 = new CalculationItemDto();
        calculationItem1.setPathExpression(new PathExpression(new Long[]{1L, 2L, 3L}));
        CalculationItemDto calculationItem2 = new CalculationItemDto();
        calculationItem2.setPathExpression(new PathExpression(new Long[]{1L, 2L, 4L}));
        List<CalculationItemDto> calculationItems = new ArrayList<CalculationItemDto>();
        calculationItems.add(calculationItem1);
        calculationItems.add(calculationItem2);
        calculation.setItems(calculationItems);
        calculationTree.build(calculation);
View Full Code Here

Examples of lv.odylab.evemanage.client.rpc.PathExpression

    }

    @Test
    public void testCreateNode_FirstNodeMustBeIgnored() {
        CalculationItemDto calculationItem = new CalculationItemDto();
        calculationItem.setPathExpression(new PathExpression(new Long[]{1L, 2L, 3L}));
        calculationTree.createNode(calculationItem);

        Map<Long, CalculationTreeNode> nodeMap = calculationTree.getNodeMap();
        assertNull(nodeMap.get(1L));
        CalculationTreeNode node2 = nodeMap.get(2L);
View Full Code Here

Examples of lv.odylab.evemanage.client.rpc.PathExpression

    }

    @Test
    public void testCreateNode_AddingChildren() {
        CalculationItemDto calculationItem1 = new CalculationItemDto();
        calculationItem1.setPathExpression(new PathExpression(new Long[]{1L, 2L, 3L}));
        calculationTree.createNode(calculationItem1);
        CalculationItemDto calculationItem2 = new CalculationItemDto();
        calculationItem2.setPathExpression(new PathExpression(new Long[]{1L, 2L, 4L}));
        calculationTree.createNode(calculationItem2);

        Map<Long, CalculationTreeNode> nodeMap = calculationTree.getNodeMap().get(2L).getNodeMap();
        CalculationTreeNode node3 = nodeMap.get(3L);
        CalculationTreeNode node4 = nodeMap.get(4L);
View Full Code Here

Examples of lv.odylab.evemanage.client.rpc.PathExpression

    }

    @Test
    public void testCreateNode_AddingManyChildren() {
        CalculationItemDto calculationItem1 = new CalculationItemDto();
        calculationItem1.setPathExpression(new PathExpression(new Long[]{1L, 2L, 3L}));
        calculationTree.createNode(calculationItem1);
        CalculationItemDto calculationItem2 = new CalculationItemDto();
        calculationItem2.setPathExpression(new PathExpression(new Long[]{1L, 2L, 4L}));
        calculationTree.createNode(calculationItem2);
        CalculationItemDto calculationItem3 = new CalculationItemDto();
        calculationItem3.setPathExpression(new PathExpression(new Long[]{1L, 5L, 6L}));
        calculationTree.createNode(calculationItem3);
        CalculationItemDto calculationItem4 = new CalculationItemDto();
        calculationItem4.setPathExpression(new PathExpression(new Long[]{1L, 5L, 7L}));
        calculationTree.createNode(calculationItem4);

        Map<Long, CalculationTreeNode> nodeMap = calculationTree.getNodeMap().get(2L).getNodeMap();
        CalculationTreeNode node3 = nodeMap.get(3L);
        CalculationTreeNode node4 = nodeMap.get(4L);
View Full Code Here

Examples of lv.odylab.evemanage.client.rpc.PathExpression

    }

    @Test
    public void testGetNodeByPathNodes() {
        CalculationItemDto calculationItem = new CalculationItemDto();
        calculationItem.setPathExpression(new PathExpression(new Long[]{1L, 2L, 3L}));
        calculationTree.createNode(calculationItem);

        assertNotNull(calculationTree.getNodeByPathNodes(new Long[]{1L, 2L, 3L}));
    }
View Full Code Here

Examples of lv.odylab.evemanage.client.rpc.PathExpression

    }

    @Test
    public void testGetNodeByPathNodes_Many() {
        CalculationItemDto calculationItem1 = new CalculationItemDto();
        calculationItem1.setPathExpression(new PathExpression(new Long[]{1L, 2L, 3L}));
        calculationTree.createNode(calculationItem1);
        CalculationItemDto calculationItem2 = new CalculationItemDto();
        calculationItem2.setPathExpression(new PathExpression(new Long[]{1L, 2L, 4L}));
        calculationTree.createNode(calculationItem2);
        CalculationItemDto calculationItem3 = new CalculationItemDto();
        calculationItem3.setPathExpression(new PathExpression(new Long[]{1L, 5L, 6L}));
        calculationTree.createNode(calculationItem3);
        CalculationItemDto calculationItem4 = new CalculationItemDto();
        calculationItem4.setPathExpression(new PathExpression(new Long[]{1L, 5L, 7L}));
        calculationTree.createNode(calculationItem4);

        assertNotNull(calculationTree.getNodeByPathNodes(new Long[]{1L, 2L, 3L}));
        assertNotNull(calculationTree.getNodeByPathNodes(new Long[]{1L, 2L, 4L}));
        assertNotNull(calculationTree.getNodeByPathNodes(new Long[]{1L, 5L, 6L}));
View Full Code Here

Examples of lv.odylab.evemanage.client.rpc.PathExpression

        }
        return calculationPriceSetItem;
    }

    private Long calculateQuantityForCalculationItem(CalculationItemDto calculationItem) {
        PathExpression pathExpression = calculationItem.getPathExpression();
        if (pathExpression.isMaterial()) {
            return calculator.calculateMaterialAmount(calculationItem.getPerfectQuantity(), pathExpression.getMeLevel(), calculationItem.getWasteFactor());
        } else {
            return calculationItem.getPerfectQuantity();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.