Examples of Iterator


Examples of java.util.Iterator

    void addElementProperty(String name, Object value ) throws XMLStreamException {
        if ( value == null ) {
            throw new IllegalArgumentException( QueryPlugin.Util.getString("ERR.015.002.0010", name) ); //$NON-NLS-1$
        }
        if (value instanceof Collection){
            Iterator i = ((Collection)value).iterator();
            while (i.hasNext()) {
              writeElement(name, getXMLText(i.next()));
      }
        } else {
          writeElement(name, getXMLText(value));
        }
    }
View Full Code Here

Examples of java.util.Iterator

        Set tickers = getTickers(query);
        if(tickers.size() == 0) {
            throw new TranslatorException(YahooPlugin.Util.getString("YahooExecution.No_tickers")); //$NON-NLS-1$
        }
        String urlAppendChar = YahooPlugin.Util.getString("YahooExecution.URL_APPEND_CHAR"); //$NON-NLS-1$
        Iterator tickerIter = tickers.iterator();
        url.append(tickerIter.next());       
        while(tickerIter.hasNext()) {
            url.append(urlAppendChar);
            url.append(tickerIter.next());
        }
                      
        url.append(YahooPlugin.Util.getString("YahooExecution.URL_END")); //$NON-NLS-1$             
        return url.toString();
    }
View Full Code Here

Examples of java.util.Iterator

     * @param select
     * @return
     */
    static int[] getNeededColumns(List<DerivedColumn> select, RuntimeMetadata metadata) throws TranslatorException {
        int[] cols = new int[select.size()];
        Iterator iter = select.iterator();
        for(int i=0; iter.hasNext(); i++) {
            DerivedColumn symbol = (DerivedColumn) iter.next();
            Expression expr = symbol.getExpression();
            if(expr instanceof ColumnReference) {
                Column element = ((ColumnReference)expr).getMetadataObject();
                cols[i] = element.getPosition();
            } else {
View Full Code Here

Examples of java.util.Iterator

        //and non-exhaustive searches
        if (regionCount > EXHAUSTIVE_SEARCH_GROUPS) {
            exhaustive = Math.max(2, EXHAUSTIVE_SEARCH_GROUPS - (int)Math.ceil(Math.sqrt((regionCount - EXHAUSTIVE_SEARCH_GROUPS))));
        }
       
        Iterator permIter = perms.generate(exhaustive);
       
        while(permIter.hasNext()) {
            Object[] order = (Object[]) permIter.next();

            double score = region.scoreRegion(order, 0, metadata, capFinder, context);
            if(score < bestSubScore) {
                bestSubScore = score;
                bestSubOrder = order;
View Full Code Here

Examples of java.util.Iterator

                                 int[] ndvs,
                                 int[] nnvs,
                                 String[] mins,
                                 String[] maxs) {
       
        Iterator iter = elementObjects.iterator();
        for(int i=0; iter.hasNext(); i++) {
            FakeMetadataObject obj = (FakeMetadataObject) iter.next();
            if(ndvs != null) {
                obj.putProperty(FakeMetadataObject.Props.DISTINCT_VALUES, new Integer(ndvs[i]));
            }
            if(nnvs != null) {
                obj.putProperty(FakeMetadataObject.Props.NULL_VALUES, new Integer(nnvs[i]));
View Full Code Here

Examples of java.util.Iterator

   * @return Deep copy of object
   */
  public Object clone() {
      List thisSymbols = getSymbols();
      List copySymbols = new ArrayList(thisSymbols.size());
      Iterator iter = thisSymbols.iterator();
      while(iter.hasNext()) {
        Expression es = (Expression) iter.next();
        copySymbols.add(es.clone());
      }

    return new GroupBy(copySymbols);
  }
View Full Code Here

Examples of java.util.Iterator

            return false;
          }
            boolean supportsFunctionsInGroupBy = caps.supportsCapability(Capability.QUERY_FUNCTIONS_IN_GROUP_BY);

            // Also verify that if there is a function that we can support pushdown of functions in group by
            Iterator colIter = groupCols.iterator();
            while(colIter.hasNext()) {
                Expression col = (Expression) colIter.next();
                if(!(col instanceof ElementSymbol) && !supportsFunctionsInGroupBy) {
                    // Function in GROUP BY can't be pushed
                    return false;
                }
            }
View Full Code Here

Examples of java.util.Iterator

  }
  String name = null;
  String thisValue = null;
  String thatValue = null;
  Set entries = parameters.entrySet();
  Iterator iterator = entries.iterator();
  Map.Entry entry = null;
  while (iterator.hasNext()) {
      entry = (Map.Entry)iterator.next();
      name = (String)entry.getKey();
      thisValue = (String)entry.getValue();
      thatValue = (String)that.parameters.get(name);
      if ((thisValue == null) || (thatValue == null)) {
    // both null -> equal, only one null -> not equal
View Full Code Here

Examples of java.util.Iterator

            //criteria cannot be pushed out of a full outer join clause
            if (joinType == JoinType.JOIN_FULL_OUTER || joinType == JoinType.JOIN_CROSS) {
                continue;
            }
           
            Iterator crits = criteria.iterator();
            while (crits.hasNext()) {
                Criteria crit = (Criteria)crits.next();
                               
                //special case handling for true/false criteria
                if (crit.equals(QueryRewriter.FALSE_CRITERIA) || crit.equals(QueryRewriter.UNKNOWN_CRITERIA)) {
                    if (joinType == JoinType.JOIN_INNER) {
                        FrameUtil.replaceWithNullNode(node);
                    } else {
                        //must be a left or right outer join, replace the inner side with null 
                        FrameUtil.replaceWithNullNode(JoinUtil.getInnerSideJoinNodes(node)[0]);
                        removeCopiedFlag = true;
                    }
                    //since a null node has been created, raise it to its highest point
                    pushRuleRaiseNull = true;
                    treeChanged = true;
                    break;
                } else if (crit.equals(QueryRewriter.TRUE_CRITERIA)) {
                    crits.remove();
                    break;
                }
               
                if (pushCriteria(node, crit)) {
                    treeChanged = true;
                    crits.remove();
                }
            }
           
            //degrade the join if there is no criteria left
            if (criteria.isEmpty() && joinType == JoinType.JOIN_INNER) {
View Full Code Here

Examples of java.util.Iterator

     * @param expression
     * @return
     * @since 4.2
     */
    private static boolean containsFunctionsThatCannotBePushed(Expression expression) {
        Iterator functions = FunctionCollectorVisitor.getFunctions(expression, true).iterator();
        while (functions.hasNext()) {
            Function function = (Function)functions.next();
            if (function.getFunctionDescriptor().getPushdown() == PushDown.CANNOT_PUSHDOWN) {
                return true;
            }
        }
        return false;
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.