Package org.mantikhor.llapi

Examples of org.mantikhor.llapi.BaseProperty


     */
    public void testGetParents()
    {
        assertNotNull(this.treeI);
       
        BaseProperty propD = this.getProperty(TreeImplTest.PROPERTIES.D);
        List<BaseProperty> parentsD = this.treeI.getParents(propD);
        assertTrue(parentsD.size() == 1);
        BaseProperty parentDFromTree = parentsD.get(0);

        BaseProperty E = this.getProperty(TreeImplTest.PROPERTIES.E);
        List<BaseProperty> parentsE = this.treeI.getParents(E);
        assertTrue(parentsE.size() == 1);
        BaseProperty parentEFromTree = parentsE.get(0);

        BaseProperty F = this.getProperty(TreeImplTest.PROPERTIES.F);
        List<BaseProperty> parentsF = this.treeI.getParents(F);
        assertTrue(parentsF.size() == 1);
        BaseProperty parentFFromTree = parentsF.get(0);

        BaseProperty G = this.getProperty(TreeImplTest.PROPERTIES.G);
        List<BaseProperty> parentsG = this.treeI.getParents(G);
        assertTrue(parentsG.size() == 1);
        BaseProperty parentGFromTree = parentsG.get(0);

        BaseProperty H = this.getProperty(TreeImplTest.PROPERTIES.H);
        List<BaseProperty> parentsH = this.treeI.getParents(H);
        assertTrue(parentsH.size() == 1);
        BaseProperty parentHFromTree = parentsH.get(0);

        BaseProperty I = this.getProperty(TreeImplTest.PROPERTIES.I);
        List<BaseProperty> parentsI = this.treeI.getParents(I);
        assertTrue(parentsI.size() == 1);
        BaseProperty parentIFromTree = parentsI.get(0);

        BaseProperty J = this.getProperty(TreeImplTest.PROPERTIES.J);
        List<BaseProperty> parentsJ = this.treeI.getParents(J);
        assertTrue(parentsJ.size() == 1);
        BaseProperty parentJFromTree = parentsJ.get(0);

        BaseProperty propK = this.getProperty(TreeImplTest.PROPERTIES.K);
        List<BaseProperty> parentsK = this.treeI.getParents(propK);
        assertTrue(parentsK.size() == 1);
        BaseProperty parentKFromTree = parentsK.get(0);

        BaseProperty propL = this.getProperty(TreeImplTest.PROPERTIES.L);
        List<BaseProperty> parentsL = this.treeI.getParents(propL);
        assertTrue(parentsL.size() == 1);
        BaseProperty parentLFromTree = parentsL.get(0);
       
        BaseProperty A = this.getProperty(TreeImplTest.PROPERTIES.A);
        BaseProperty B = this.getProperty(TreeImplTest.PROPERTIES.B);
        BaseProperty C = this.getProperty(TreeImplTest.PROPERTIES.C);

        List<BaseProperty> parentsA = this.treeI.getParents(A);
        List<BaseProperty> parentsB = this.treeI.getParents(B);
        List<BaseProperty> parentsC = this.treeI.getParents(C);
       
        assertTrue(parentsA.size()==0);
        assertTrue(parentsB.size()==0);
        assertTrue(parentsC.size()==0);
       
        assertTrue(A.equals(parentDFromTree));
        assertTrue(A.equals(parentEFromTree));
        assertTrue(A.equals(parentFFromTree));

        assertTrue(B.equals(parentGFromTree));
        assertTrue(B.equals(parentHFromTree));
        assertTrue(B.equals(parentIFromTree));

        assertTrue(C.equals(parentJFromTree));
        assertTrue(C.equals(parentKFromTree));
        assertTrue(C.equals(parentLFromTree));
    }
View Full Code Here


        {
            if (!node.equals(getNode(TreeImplTest.NODES.NAME_NODE_TREEI)))
            {
                List<BaseProperty> properties = this.treeI.getAllPropertiesWithValue((PropertyValNode)node);
                assertTrue(properties.size() == 1);
                BaseProperty prop = properties.get(0);
                assertTrue(this.properties.containsValue(prop));               
            }
        }
    }
View Full Code Here

     * Test method for {@link org.mantikhor.llapi.impl.TreeImpl#getPathset(org.mantikhor.llapi.BaseProperty)}.
     */
    public void testGetPathsetBaseProperty()
    {
        assertNotNull(this.treeI);
        BaseProperty A = this.getProperty(TreeImplTest.PROPERTIES.A);
        Set<Path> paths = this.treeI.getPathset(A);
        assertTrue(paths.size() == 3);
        Path[] arrayOfPaths = new Path[paths.size()];
        paths.toArray(arrayOfPaths);
        assertTrue(arrayOfPaths.length == 3);
View Full Code Here

            updateNode(TreeImplTest.NODES.values()[ndx], resNode);

            PropertyDefinition propDef =
                this.getDefinition(TreeImplTest.DEFINITIONS.values()[ndx]);
           
            BaseProperty prop =
                PropertyImpl.valueByDefNodeKhorIDReef(
                        propDef,
                        resNode,
                        KhoronImpl.getInstance().nextKhorID(),
                        null
View Full Code Here

            updateNode(TreeImplTest.NODES.values()[ndx], resNode);

            PropertyDefinition propDef =
                this.getDefinition(TreeImplTest.DEFINITIONS.values()[ndx]);
           
            BaseProperty prop =
                PropertyImpl.valueByDefNodeKhorIDReef(
                        propDef,
                        resNode,
                        KhoronImpl.getInstance().nextKhorID(),
                        null
View Full Code Here

        // 3. Create the return value instance
        List<BaseProperty> returnValue = new ArrayList<BaseProperty>();

        // 4. We start with the terminatingProperty
        BaseProperty underExamination = terminatingProperty;

        // 5. Add it (at position zero) to the return list.
        returnValue.add(0, terminatingProperty);

        while (true)
View Full Code Here

            return this;
        }
       
        for (int indx = 0; indx < this.size(); indx++)
        {
            BaseProperty curProp = this.get(indx);
            if (newStartNode.equals(curProp.getPropertyValueNode()))
            {
                // we have found it
               
                return new PathImpl
                    (newStartNode, this.propertyList.subList(indx, this.size()));
View Full Code Here

        int maxLength = Math.max(this.size(), otherAsPI.size());
        List<BaseProperty> commonList = new ArrayList<BaseProperty>(maxLength);
        List<BaseProperty> firstNotSecondList = new ArrayList<BaseProperty>(maxLength);
        List<BaseProperty> secondNotFirstList = new ArrayList<BaseProperty>(maxLength);
       
        BaseProperty curFromThis;
        BaseProperty curFromOther;
        for (int indx = 0; indx < maxLength; indx++)
        {
            if (indx > this.size())
            {
                curFromThis = null;
View Full Code Here

TOP

Related Classes of org.mantikhor.llapi.BaseProperty

Copyright © 2018 www.massapicom. 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.