Examples of PathExpression


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

            createNode(calculationItem);
        }
    }

    public void createNode(CalculationItemDto calculationItem) {
        PathExpression pathExpression = calculationItem.getPathExpression();
        Long[] pathNodes = pathExpression.getPathNodes();
        Map<Long, CalculationTreeNode> currentNodes = nodeMap;
        for (int i = 1; i < pathNodes.length - 1; i++) {
            Long pathNode = pathNodes[i];
            CalculationTreeNode node = currentNodes.get(pathNode);
            if (node == null) {
View Full Code Here

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

    public void changeRootNodesMePeQuantity(Integer meLevel, Integer peLevel, Long quantity) {
        for (Map.Entry<Long, CalculationTreeNode> mapEntry : nodeMap.entrySet()) {
            CalculationTreeNode node = mapEntry.getValue();
            List<CalculationItemDto> calculationItems = node.getCalculationItems();
            for (CalculationItemDto calculationItem : calculationItems) {
                PathExpression pathExpression = calculationItem.getPathExpression();
                if (pathExpression.isMaterial()) {
                    pathExpression.setMeLevel(meLevel);
                    pathExpression.setPeLevel(peLevel);
                }
                calculationItem.setParentQuantity(quantity);
            }
        }
    }
View Full Code Here

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

                recursivelyPopulateCalculationExpressionWithBlueprintInformation(pathNodes, calculationTreeNode, pathNodesToPathExpressionMap);
            }
        }
        for (Map.Entry<String, PathExpression> entry : pathNodesToPathExpressionMap.entrySet()) {
            String blueprintPath = entry.getKey();
            PathExpression pathExpression = entry.getValue();
            calculationExpression.getBlueprintPathToMeLevelMap().put(blueprintPath, pathExpression.getMeLevel());
            calculationExpression.getBlueprintPathToPeLevelMap().put(blueprintPath, pathExpression.getPeLevel());
        }
    }
View Full Code Here

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

    }

    public CalculationTreeNodeSummary getSummary() {
        CalculationTreeNodeSummary summary = new CalculationTreeNodeSummary();
        CalculationItemDto firstCalculationItemDto = calculationItems.get(0);
        PathExpression pathExpression = firstCalculationItemDto.getPathExpression();
        summary.setPathNodesString(pathExpression.getPathNodesString());
        summary.setPathNodes(pathExpression.getPathNodes());
        summary.setItemTypeID(firstCalculationItemDto.getItemTypeID());
        summary.setItemCategoryID(firstCalculationItemDto.getItemCategoryID());
        summary.setItemTypeName(firstCalculationItemDto.getItemTypeName());
        summary.setItemTypeIcon(firstCalculationItemDto.getItemTypeIcon());
        summary.setParentQuantity(firstCalculationItemDto.getParentQuantity());
View Full Code Here

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

        this.excludeChildNodesFromCalculation = excludeChildNodesFromCalculation;
    }

    public void changeMePe(Integer meLevel, Integer peLevel) {
        for (CalculationItemDto calculationItem : calculationItems) {
            PathExpression pathExpression = calculationItem.getPathExpression();
            if (pathExpression.isMaterial()) {
                pathExpression.setMeLevel(meLevel);
                pathExpression.setPeLevel(peLevel);
            }
            for (Map.Entry<Long, CalculationTreeNode> mapEntry : nodeMap.entrySet()) {
                CalculationTreeNode node = mapEntry.getValue();
                List<CalculationItemDto> nodeCalculationItems = node.getCalculationItems();
                for (CalculationItemDto nodeCalculationItem : nodeCalculationItems) {
                    PathExpression nodePathExpression = nodeCalculationItem.getPathExpression();
                    if (nodePathExpression.isMaterial()) {
                        nodePathExpression.setMeLevel(meLevel);
                        nodePathExpression.setPeLevel(peLevel);
                    }
                }
            }
        }
    }
View Full Code Here

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

        List<TypeRequirementDto> requirementDtos = blueprintDetailsDto.getManufacturingRequirementDtos();
        List<CalculationItem> calculationItems = new ArrayList<CalculationItem>();

        for (TypeMaterialDto materialDto : materialDtos) {
            CalculationItem calculationItem = new CalculationItem();
            PathExpression pathExpression = new PathExpression(pathNodes, calculation.getMaterialLevel(), calculation.getProductivityLevel(), materialDto.getMaterialTypeID());
            calculationItem.setPath(pathExpression.getPath());
            calculationItem.setItemTypeID(materialDto.getMaterialTypeID());
            calculationItem.setItemCategoryID(materialDto.getMaterialTypeCategoryID());
            calculationItem.setItemTypeName(materialDto.getMaterialTypeName());
            calculationItem.setItemTypeIcon(materialDto.getMaterialTypeGraphicIcon());
            calculationItem.setQuantity(materialDto.getQuantity());
            calculationItem.setParentQuantity(1L);
            calculationItem.setPerfectQuantity(materialDto.getQuantity());
            calculationItem.setWasteFactor(blueprintTypeDto.getWasteFactor());
            calculationItem.setDamagePerJob("1.00");
            String price = priceSetItemTypeIdToPriceMap.get(materialDto.getMaterialTypeID());
            calculationItem.setPrice(price == null ? "0.00" : price);
            calculationItem.setTotalPrice("0.00");
            calculationItem.setTotalPriceForParent("0.00");
            calculationItems.add(calculationItem);
        }

        for (TypeRequirementDto requirementDto : requirementDtos) {
            if (requirementDto.getRequiredTypeCategoryID() == 16L) {
                continue;
            }
            CalculationItem calculationItem = new CalculationItem();
            PathExpression pathExpression = new PathExpression(pathNodes, requirementDto.getRequiredTypeID());
            calculationItem.setPath(pathExpression.getPath());
            calculationItem.setItemTypeID(requirementDto.getRequiredTypeID());
            calculationItem.setItemCategoryID(requirementDto.getRequiredTypeCategoryID());
            calculationItem.setItemTypeName(requirementDto.getRequiredTypeName());
            calculationItem.setItemTypeIcon(requirementDto.getRequiredTypeNameGraphicIcon());
            calculationItem.setQuantity(requirementDto.getQuantity());
View Full Code Here

Examples of net.sf.saxon.expr.PathExpression

        if (!(subExpr instanceof PathExpression)) {
            return;
        }

        Document document = DOMUtils.toDOMDocument(contextNode);
        PathExpression pathExpr = (PathExpression) subExpr;
        Expression step = pathExpr.getFirstStep();

        while (step != null) {
            if (step instanceof AxisExpression) {
                AxisExpression axisExpr = (AxisExpression) step;

                NodeTest nodeTest = axisExpr.getNodeTest();

                if (!(nodeTest instanceof NameTest)) {
                    break;
                }

                NameTest nameTest = (NameTest) nodeTest;

                QName childName = getQualifiedName(nameTest.getFingerprint(),
                        namePool, contextUris);

                if (Axis.CHILD == axisExpr.getAxis()) {
                    if (NodeKindTest.ELEMENT.getNodeKindMask() != nameTest.getNodeKindMask()) {
                        break;
                    }

                    NodeList children = ((Element) contextNode).getElementsByTagNameNS(childName.getNamespaceURI(),
                            childName.getLocalPart());
                    if ((children == null) || (children.getLength() == 0)) {
                        Node child = document.createElementNS(childName.getNamespaceURI(),
                                DOMUtils.getQualifiedName(childName));
                        contextNode.appendChild(child);
                        contextNode = child;
                    } else if (children.getLength() == 1) {
                        contextNode = children.item(0);
                    } else {
                        break;
                    }
                } else if (Axis.ATTRIBUTE == axisExpr.getAxis()) {
                    if (NodeKindTest.ATTRIBUTE.getNodeKindMask() != nameTest.getNodeKindMask()) {
                        break;
                    }

                    Attr attribute = ((Element) contextNode).getAttributeNodeNS(childName.getNamespaceURI(), childName.getLocalPart());
                    if (attribute == null) {
                        attribute = document.createAttributeNS(childName.getNamespaceURI(), childName.getLocalPart());
                        ((Element) contextNode).setAttributeNode(attribute);
                        contextNode = attribute;
                    } else {
                        break;
                    }

                } else {
                    break;
                }


            } else if (step instanceof ItemChecker) {
                ItemChecker itemChecker = (ItemChecker) step;
                Expression baseExpr = itemChecker.getBaseExpression();

                if (!(baseExpr instanceof VariableReference)) {
                    break;
                }
            } else {
                break;
            }

            if (pathExpr != null) {
                Expression remainingSteps = pathExpr.getRemainingSteps();

                if (remainingSteps instanceof PathExpression) {
                    pathExpr = (PathExpression) remainingSteps;
                    step = pathExpr.getFirstStep();
                } else if (remainingSteps instanceof AxisExpression) {
                    pathExpr = null;
                    step = (AxisExpression) remainingSteps;
                }
            } else {
View Full Code Here

Examples of net.sf.saxon.expr.PathExpression

        if (!(subExpr instanceof PathExpression)) {
            return;
        }

        Document document = DOMUtils.toDOMDocument(contextNode);
        PathExpression pathExpr = (PathExpression) subExpr;
        Expression step = pathExpr.getFirstStep();

        while (step != null) {
            if (step instanceof AxisExpression) {
                AxisExpression axisExpr = (AxisExpression) step;

                NodeTest nodeTest = axisExpr.getNodeTest();

                if (!(nodeTest instanceof NameTest)) {
                    break;
                }

                NameTest nameTest = (NameTest) nodeTest;

                QName childName = getQualifiedName(nameTest.getFingerprint(),
                        namePool, contextUris);
               
                if (Axis.CHILD == axisExpr.getAxis()) {
                    if (NodeKindTest.ELEMENT.getNodeKindMask() != nameTest.getNodeKindMask()) {
                        break;
                    }
                 
                    NodeList children = ((Element) contextNode).getElementsByTagNameNS(childName.getNamespaceURI(),
                            childName.getLocalPart());
                    if ((children == null) || (children.getLength() == 0)) {
                        Node child = document.createElementNS(childName.getNamespaceURI(),
                                DOMUtils.getQualifiedName(childName));
                        contextNode.appendChild(child);
                        contextNode = child;
                    } else if (children.getLength() == 1) {
                        contextNode = children.item(0);
                    } else {
                        break;
                    }
                } else if (Axis.ATTRIBUTE == axisExpr.getAxis()) {
                    if (NodeKindTest.ATTRIBUTE.getNodeKindMask() != nameTest.getNodeKindMask()) {
                        break;
                    }
                   
                    Attr attribute = ((Element) contextNode).getAttributeNodeNS(childName.getNamespaceURI(), childName.getLocalPart());
                    if (attribute == null) {
                      attribute = document.createAttributeNS(childName.getNamespaceURI(), childName.getLocalPart());
                      ((Element) contextNode).setAttributeNode(attribute);
                      contextNode = attribute;
                    } else {
                      break;
                    }
                 
                } else {
                  break;
                }


            } else if (step instanceof ItemChecker) {
                ItemChecker itemChecker = (ItemChecker) step;
                Expression baseExpr = itemChecker.getBaseExpression();

                if (!(baseExpr instanceof VariableReference)) {
                    break;
                }
            } else {
                break;
            }

            if (pathExpr != null) {
                Expression remainingSteps = pathExpr.getRemainingSteps();

                if (remainingSteps instanceof PathExpression) {
                    pathExpr = (PathExpression) remainingSteps;
                    step = pathExpr.getFirstStep();
                } else if (remainingSteps instanceof AxisExpression) {
                    pathExpr = null;
                    step = (AxisExpression) remainingSteps;
                }
            } else {
View Full Code Here

Examples of net.sf.saxon.expr.PathExpression

        if (!(subExpr instanceof PathExpression)) {
            return;
        }

        Document document = contextNode.getOwnerDocument();
        PathExpression pathExpr = (PathExpression) subExpr;
        Expression step = pathExpr.getFirstStep();

        while (step != null) {
            if (step instanceof AxisExpression) {
                AxisExpression axisExpr = (AxisExpression) step;

                NodeTest nodeTest = axisExpr.getNodeTest();

                if (!(nodeTest instanceof NameTest)) {
                    break;
                }

                NameTest nameTest = (NameTest) nodeTest;

                QName childName = getQualifiedName(nameTest.getFingerprint(),
                        namePool, contextUris);

                if (Axis.CHILD == axisExpr.getAxis()) {
                    if (NodeKindTest.ELEMENT.getNodeKindMask() != nameTest.getNodeKindMask()) {
                        break;
                    }

                    NodeList children = ((Element) contextNode).getElementsByTagNameNS(childName.getNamespaceURI(),
                            childName.getLocalPart());
                    if ((children == null) || (children.getLength() == 0)) {
                        Node child = document.createElementNS(childName.getNamespaceURI(),
                                DOMUtils.getQualifiedName(childName));
                        contextNode.appendChild(child);
                        contextNode = child;
                    } else if (children.getLength() == 1) {
                        contextNode = children.item(0);
                    } else {
                        break;
                    }
                } else if (Axis.ATTRIBUTE == axisExpr.getAxis()) {
                    if (NodeKindTest.ATTRIBUTE.getNodeKindMask() != nameTest.getNodeKindMask()) {
                        break;
                    }

                    Attr attribute = ((Element) contextNode).getAttributeNodeNS(childName.getNamespaceURI(), childName.getLocalPart());
                    if (attribute == null) {
                        attribute = document.createAttributeNS(childName.getNamespaceURI(), childName.getLocalPart());
                        ((Element) contextNode).setAttributeNode(attribute);
                        contextNode = attribute;
                    } else {
                        break;
                    }

                } else {
                    break;
                }


            } else if (step instanceof ItemChecker) {
                ItemChecker itemChecker = (ItemChecker) step;
                Expression baseExpr = itemChecker.getBaseExpression();

                if (!(baseExpr instanceof VariableReference)) {
                    break;
                }
            } else {
                break;
            }

            if (pathExpr != null) {
                Expression remainingSteps = pathExpr.getRemainingSteps();

                if (remainingSteps instanceof PathExpression) {
                    pathExpr = (PathExpression) remainingSteps;
                    step = pathExpr.getFirstStep();
                } else if (remainingSteps instanceof AxisExpression) {
                    pathExpr = null;
                    step = (AxisExpression) remainingSteps;
                } else {
                    throw new RuntimeException("Not supported step " + remainingSteps + " in expression " + expression);
View Full Code Here

Examples of net.sf.saxon.expr.PathExpression

        if (!(subExpr instanceof PathExpression)) {
            return;
        }

        Document document = DOMUtils.toDOMDocument(contextNode);
        PathExpression pathExpr = (PathExpression) subExpr;
        Expression step = pathExpr.getFirstStep();

        while (step != null) {
            if (step instanceof AxisExpression) {
                AxisExpression axisExpr = (AxisExpression) step;

                NodeTest nodeTest = axisExpr.getNodeTest();

                if (!(nodeTest instanceof NameTest)) {
                    break;
                }

                NameTest nameTest = (NameTest) nodeTest;

                QName childName = getQualifiedName(nameTest.getFingerprint(),
                        namePool, contextUris);
               
                if (Axis.CHILD == axisExpr.getAxis()) {
                    if (NodeKindTest.ELEMENT.getNodeKindMask() != nameTest.getNodeKindMask()) {
                        break;
                    }
                 
                    NodeList children = ((Element) contextNode).getElementsByTagNameNS(childName.getNamespaceURI(),
                            childName.getLocalPart());
                    if ((children == null) || (children.getLength() == 0)) {
                        Node child = document.createElementNS(childName.getNamespaceURI(),
                                DOMUtils.getQualifiedName(childName));
                        contextNode.appendChild(child);
                        contextNode = child;
                    } else if (children.getLength() == 1) {
                        contextNode = children.item(0);
                    } else {
                        break;
                    }
                } else if (Axis.ATTRIBUTE == axisExpr.getAxis()) {
                    if (NodeKindTest.ATTRIBUTE.getNodeKindMask() != nameTest.getNodeKindMask()) {
                        break;
                    }
                   
                    Attr attribute = ((Element) contextNode).getAttributeNodeNS(childName.getNamespaceURI(), childName.getLocalPart());
                    if (attribute == null) {
                      attribute = document.createAttributeNS(childName.getNamespaceURI(), childName.getLocalPart());
                      ((Element) contextNode).setAttributeNode(attribute);
                      contextNode = attribute;
                    } else {
                      break;
                    }
                 
                } else {
                  break;
                }


            } else if (step instanceof ItemChecker) {
                ItemChecker itemChecker = (ItemChecker) step;
                Expression baseExpr = itemChecker.getBaseExpression();

                if (!(baseExpr instanceof VariableReference)) {
                    break;
                }
            } else {
                break;
            }

            if (pathExpr != null) {
                Expression remainingSteps = pathExpr.getRemainingSteps();

                if (remainingSteps instanceof PathExpression) {
                    pathExpr = (PathExpression) remainingSteps;
                    step = pathExpr.getFirstStep();
                } else if (remainingSteps instanceof AxisExpression) {
                    pathExpr = null;
                    step = (AxisExpression) remainingSteps;
                } else {
                    throw new RuntimeException("Not supported step " + remainingSteps + " in expression " + expression);
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.