Package java.util

Examples of java.util.List


        es1.setType(DataTypeManager.DefaultDataClasses.INTEGER);

        ElementSymbol es2 = new ElementSymbol("e2"); //$NON-NLS-1$
        es2.setType(DataTypeManager.DefaultDataClasses.STRING);
       
        List elements = new ArrayList();
        elements.add(es1);
        elements.add(es2);
       
        List[] data = new List[0];
       
        List projectElements = new ArrayList();
        projectElements.add(es1);
        projectElements.add(es2);
       
        helpTestProject(elements, data, projectElements, data, null);
       
    }
View Full Code Here


        es1.setType(DataTypeManager.DefaultDataClasses.INTEGER);

        ElementSymbol es2 = new ElementSymbol("e2"); //$NON-NLS-1$
        es2.setType(DataTypeManager.DefaultDataClasses.STRING);
       
        List elements = new ArrayList();
        elements.add(es1);
        elements.add(es2);
       
        List projectElements = new ArrayList();
        projectElements.add(es1);
        projectElements.add(es2);
       
        List[] data = new List[20];
        for(int i=0; i<20; i++) {
            data[i] = new ArrayList();
            data[i].add(new Integer((i*51) % 11));
View Full Code Here

        if(modelName != null && validModels != null && ! validModels.contains(modelName)) {
            throw new TeiidComponentException("Detected query against invalid model: " + modelName + ": " + command)//$NON-NLS-1$//$NON-NLS-2$
        }
        this.commandHistory.add(command);
       
        List projectedSymbols = command.getProjectedSymbols();

        String commandString = null;
        if (lbf == null) {
          commandString = command.toString();
        } else {
          commandString = lbf.translate(command).toString();
        }
       
        List[] rows = data.get(commandString);
        if(rows == null) {
            if (mustRegisterCommands) {
                throw new TeiidComponentException("Unknown command: " + commandString)//$NON-NLS-1$
            }
            // Create one row of nulls
            rows = new List[1];
            rows[0] = new ArrayList();
           
            for(int i=0; i<projectedSymbols.size(); i++) {
                rows[0].add(null);
            }
        }
       
        FakeTupleSource source = new FakeTupleSource(projectedSymbols, rows);
View Full Code Here

        }
        assertNotNull(batch);
        assertTrue(batch.getTerminationFlag());
        assertEquals(expectedResults.length, batch.getRowCount());
        for (int i = 0; i < expectedResults.length; i++) {
            List tuple = batch.getTuple(i+1);
            assertNotNull(tuple);
            Object result = tuple.get(0);
            assertNotNull(result);
            assertEquals(new Integer(expectedResults[i]), result);
        }
        return fakePDM;
    }
View Full Code Here

    open++;
    maxOpen = Math.max(open, maxOpen);
  }

  public List getSchema() {
        List theElements = null;       
      if(expectedSymbols != null) {
      theElements = expectedSymbols;
      } else {
        theElements = elements;   
      }
View Full Code Here

            throw BlockedException.INSTANCE;           
        }
       
    if(index < tuples.length) {
        // Get full data tuple, with elements
        List tuple = tuples[index++];
       
        if(expectedSymbols == null) {
            return tuple;
        }
        // Build mapped data tuple, with expectedSymbols
        List mappedTuple = new ArrayList(expectedSymbols.size());
        for(int i=0; i<columnMap.length; i++) {
          int colIndex = columnMap[i];
                if(colIndex >= 0) {
                    mappedTuple.add( tuple.get(colIndex) );
                } else {
                    mappedTuple.add( null );
                }
        }       
      return mappedTuple;
    }
    return null;
View Full Code Here

        addChild(node);       
        return node;
    }
   
    public MappingCriteriaNode getDefaultNode() {
        List critNodes = getChildren();
        for (final Iterator i = critNodes.iterator(); i.hasNext();) {
            final MappingCriteriaNode node= (MappingCriteriaNode)i.next();
            if (node.isDefault()) {
                return node;
            }
        } // for
View Full Code Here

  public TestBatchedUpdatePlan(String name) {
        super(name);
    }
   
    private void helpTestNextBatch(int[] commandsPerPlan) throws Exception {
        List plans = new ArrayList(commandsPerPlan.length);
        int totalCommands = 0;
        for (int i = 0; i < commandsPerPlan.length; i++) {
            totalCommands += commandsPerPlan[i];
            plans.add(new FakeProcessorPlan(commandsPerPlan[i]));
        }
        BatchedUpdatePlan plan = new BatchedUpdatePlan(plans, totalCommands, null);
        TupleBatch batch = plan.nextBatch();
        assertEquals(totalCommands, batch.getRowCount());
        for (int i = 1; i <= totalCommands; i++) {
View Full Code Here

        es1.setType(DataTypeManager.DefaultDataClasses.INTEGER);

        ElementSymbol es2 = new ElementSymbol("e2"); //$NON-NLS-1$
        es2.setType(DataTypeManager.DefaultDataClasses.STRING);
       
        List elements = new ArrayList();
        elements.add(es1);
        elements.add(es2);
       
        List[] data = new List[20];
        for(int i=0; i<20; i++) {
            data[i] = new ArrayList();
            data[i].add(new Integer((i*51) % 11));
           
            String str = String.valueOf(i*3);
            str = str.substring(0,1);
            data[i].add(str);             
        }
       
        List sortElements = new ArrayList();
        sortElements.add(es1);
       
        List sortTypes = new ArrayList();
        sortTypes.add(new Boolean(OrderBy.ASC));
       
        helpTestSort(elements, data, sortElements, sortTypes, expected, mode);
    }
View Full Code Here

   
    private void helpTestAllSorts(int batches) throws Exception {
        ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$
        es1.setType(DataTypeManager.DefaultDataClasses.INTEGER);

        List elements = new ArrayList();
        elements.add(es1);
       
        int rows = batches * BATCH_SIZE;

        ListNestedSortComparator<Integer> comparator = new ListNestedSortComparator<Integer>(new int[] {0}, OrderBy.DESC);

        List<Integer>[] expected = new List[rows];
        List<Integer>[] data = new List[rows];
        TreeSet<List<Integer>> distinct = new TreeSet<List<Integer>>(comparator);
        for(int i=0; i<rows; i++) {
            Integer value = new Integer((i*51) % 11);
            data[i] = Arrays.asList(value);
            expected[i] = Arrays.asList(value);
            distinct.add(Arrays.asList(value));
        }
        List[] expectedDistinct = distinct.toArray(new List[distinct.size()]);
       
        List sortElements = new ArrayList();
        sortElements.add(es1);
       
        List sortTypes = new ArrayList();
        sortTypes.add(new Boolean(OrderBy.DESC));

        Arrays.sort(expected, comparator);
       
        for (Mode mode : Mode.values()) {
        helpTestSort(elements, data, sortElements, sortTypes, mode==Mode.SORT?expected:expectedDistinct, mode);
View Full Code Here

TOP

Related Classes of java.util.List

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.