Package java.util

Examples of java.util.ArrayList


        ufc.setGroup(new GroupSymbol("t2")); //$NON-NLS-1$
       
        UnaryFromClause ufc2 = new UnaryFromClause();
        ufc2.setGroup(new GroupSymbol("t3")); //$NON-NLS-1$
       
        List criteria = new ArrayList();
        criteria.add(new CompareCriteria(new ElementSymbol("t2.a"), AbstractCompareCriteria.EQ, new ElementSymbol("t3.a")));//$NON-NLS-1$//$NON-NLS-2$
        JoinPredicate joinPredicate = new JoinPredicate(ufc, ufc2, JoinType.JOIN_INNER, criteria);
        joinPredicate.setOptional(true);

        UnaryFromClause ufc3 = new UnaryFromClause();
        ufc3.setGroup(new GroupSymbol("t1")); //$NON-NLS-1$
View Full Code Here


        sfc.setOptional(true);
       
        UnaryFromClause ufc2 = new UnaryFromClause();
        ufc2.setGroup(new GroupSymbol("t3")); //$NON-NLS-1$
       
        List criteria = new ArrayList();
        criteria.add(new CompareCriteria(new ElementSymbol("x.a"), AbstractCompareCriteria.EQ, new ElementSymbol("t3.a")));//$NON-NLS-1$//$NON-NLS-2$
        JoinPredicate joinPredicate = new JoinPredicate(sfc, ufc2, JoinType.JOIN_INNER, criteria);
        joinPredicate.setOptional(true);

        UnaryFromClause ufc3 = new UnaryFromClause();
        ufc3.setGroup(new GroupSymbol("t1")); //$NON-NLS-1$
View Full Code Here

       
        UnaryFromClause ufc2 = new UnaryFromClause();
        ufc2.setGroup(new GroupSymbol("t2")); //$NON-NLS-1$
        ufc2.setOptional(true);
       
        List criteria = new ArrayList();
        criteria.add(new CompareCriteria(new ElementSymbol("t1.a"), AbstractCompareCriteria.EQ, new ElementSymbol("t2.a")));//$NON-NLS-1$//$NON-NLS-2$
        JoinPredicate joinPredicate = new JoinPredicate(ufc, ufc2, JoinType.JOIN_LEFT_OUTER, criteria);

        UnaryFromClause ufc3 = new UnaryFromClause();
        ufc3.setGroup(new GroupSymbol("t3")); //$NON-NLS-1$
        ufc3.setOptional(true);

        criteria = new ArrayList();
        criteria.add(new CompareCriteria(new ElementSymbol("t1.a"), AbstractCompareCriteria.EQ, new ElementSymbol("t3.a")));//$NON-NLS-1$//$NON-NLS-2$
        JoinPredicate joinPredicate2 = new JoinPredicate(joinPredicate, ufc3, JoinType.JOIN_LEFT_OUTER, criteria);

        from.addClause(joinPredicate2);
        query.setFrom(from);          
View Full Code Here

        ElementSymbol var1 = new ElementSymbol("var1"); //$NON-NLS-1$
        String shortType = new String("short"); //$NON-NLS-1$
        Statement declStmt = new DeclareStatement(var1, shortType);
       
        //ifblock
        List symbols = new ArrayList();
        symbols.add(new ElementSymbol("a1"))//$NON-NLS-1$
        Select select = new Select(symbols);      
       
        From from = new From();
        from.addGroup(new GroupSymbol("g")); //$NON-NLS-1$
       
        Criteria criteria = new CompareCriteria(new ElementSymbol("a2"), CompareCriteria.EQ,  //$NON-NLS-1$
            new Constant(new Integer(5)));
       
        Query query = new Query();
        query.setSelect(select);
        query.setFrom(from);
        query.setCriteria(criteria);
       
        AssignmentStatement queryStmt = new AssignmentStatement(var1, query);
             
        Block ifBlock = new Block();     
        ifBlock.addStatement(queryStmt);
       
        //else block
        ElementSymbol var2 = new ElementSymbol("var2"); //$NON-NLS-1$
        Statement elseDeclStmt = new DeclareStatement(var2, shortType);    
       
        List elseSymbols = new ArrayList();
        elseSymbols.add(new ElementSymbol("b1"))//$NON-NLS-1$
        Select elseSelect = new Select(elseSymbols);
   
        Query elseQuery = new Query();
        elseQuery.setSelect(elseSelect);
        From elseFrom = (From)from.clone();
        UnaryFromClause ufc = new UnaryFromClause();
        ufc.setGroup(new GroupSymbol("h")); //$NON-NLS-1$
        ufc.setOptional(true);
        elseFrom.addClause(ufc);
        elseQuery.setFrom(elseFrom);
        elseQuery.setCriteria(criteria);
       
        AssignmentStatement elseQueryStmt = new AssignmentStatement(var2, elseQuery);
       
        Block elseBlock = new Block();
        List elseStmts = new ArrayList();
        elseStmts.add(elseDeclStmt);
        elseStmts.add(elseQueryStmt);
     
        elseBlock.setStatements(elseStmts);
  
        //has criteria
        ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
        List elements = new ArrayList();
        elements.add(a);
       
        CriteriaSelector critSelector = new CriteriaSelector();
        critSelector.setSelectorType(CriteriaSelector.IN);
        critSelector.setElements(elements);
       
View Full Code Here

    /**
     * @param row
     * @param neededColumns
     */
    static List projectRow(List row, int[] neededColumns) {
        List output = new ArrayList(neededColumns.length);
       
        for(int i=0; i<neededColumns.length; i++) {
            output.add(row.get(neededColumns[i]-1));
        }
       
        return output;   
    }
View Full Code Here

        GroupSymbol g3 = new GroupSymbol("db.g3"); //$NON-NLS-1$
        ElementSymbol a = new ElementSymbol("a")//$NON-NLS-1$
        ElementSymbol b = new ElementSymbol("b")//$NON-NLS-1$
        ElementSymbol c = new ElementSymbol("c")//$NON-NLS-1$
       
        List crits = new ArrayList();
        crits.add(new CompareCriteria(a, CompareCriteria.EQ, b));
        JoinPredicate jp = new JoinPredicate(new UnaryFromClause(g1), new UnaryFromClause(g2), JoinType.JOIN_INNER, crits);
        jp.setMakeDep(true);
        List crits2 = new ArrayList();
        crits2.add(new CompareCriteria(a, CompareCriteria.EQ, c));
        JoinPredicate jp2 = new JoinPredicate(jp, new UnaryFromClause(g3), JoinType.JOIN_LEFT_OUTER, crits2);
        From from = new From();
        from.addClause(jp2);

        Select select = new Select();
View Full Code Here

      QueryResolver.resolveCommand(command, md);
    }
   
        ValidatorReport repo = Validator.validate(command, md);

        Collection failures = new ArrayList();
        repo.collectInvalidObjects(failures);
        if (failures.size() > 0){
            fail("Exception during validation (" + repo); //$NON-NLS-1$
        }
       
    // rewrite
    command = QueryRewriter.rewrite(command, md, new CommandContext());
View Full Code Here

            new String[] { "SELECT 1 FROM pm1.g1", //$NON-NLS-1$
                            "SELECT 1 FROM pm1.g2" } );     //$NON-NLS-1$
    }
   
    @Test public void testPushMatchCritWithReference() throws Exception {
        List bindings = new ArrayList();
        bindings.add("pm1.g2.e1"); //$NON-NLS-1$
        helpPlan("select e1 FROM pm1.g1 WHERE e1 LIKE ?", example1(), bindings, null,  //$NON-NLS-1$
            new String[] { "SELECT g_0.e1 FROM pm1.g1 AS g_0 WHERE g_0.e1 LIKE PM1.G2.e1" }, ComparisonMode.EXACT_COMMAND_STRING ); //$NON-NLS-1$
    }
View Full Code Here

            List bestOrder = null;

            for (int i = 0; i < orderList.size(); i++) {
                Integer index = orderList.get(i);
               
                List order = new ArrayList(Arrays.asList(bestSubOrder));
                order.add(index);
               
                double partialScore = region.scoreRegion(order.toArray(), bestSubOrder.length, metadata, capFinder, context);
               
                if (partialScore < bestPartialScore) {
                    bestPartialScore = partialScore;
                    bestOrder = order;
                }
View Full Code Here

    }
  }

  public void up() {
    TreeControlNode parent = getParent();
    ArrayList brothers = parent.children;
    int myIndex = brothers.indexOf(this);
    if (myIndex<brothers.size()-1) {
      TreeControlNode nextOne =
        (TreeControlNode) brothers.get(myIndex + 1);     
      brothers.set(myIndex, nextOne);
      brothers.set(myIndex + 1, this);
    }   
    rebuildLast(brothers);
  }
View Full Code Here

TOP

Related Classes of java.util.ArrayList

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.