Package java.util

Examples of java.util.Set


    static String translateIntoUrl(Select query) throws TranslatorException {
        StringBuffer url = new StringBuffer();
        url.append(YahooPlugin.Util.getString("YahooExecution.URL_BEGIN")); //$NON-NLS-1$
       
        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());
        }
View Full Code Here


       }
   }

    public static void checkAtomicQueries(String[] expectedAtomic,
                                           ProcessorPlan plan, QueryMetadataInterface md, CapabilitiesFinder capFinder) {
        Set actualQueries = getAtomicQueries(plan);
       
        HashSet<String> expectedQueries = new HashSet<String>();
       
        // Compare atomic queries
        for (int i = 0; i < expectedAtomic.length; i++) {
View Full Code Here

      return false;
  }
  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();
View Full Code Here

                        assignment = ass;
                        break;
                    }
                }
                if (assignment != null) {
                    Set conflicts = model.conflictValues(assignment);
                    if (!conflicts.isEmpty()) {
                        logger.warning("Unable to assign " + assignment.getName()
                                + " to " + activity.getName());
                    } else {
                        activity.assign(0, assignment);
                        activity.setInitialAssignment(assignment);
View Full Code Here

                        return;
                    }

                }

                Set proSet = messageContext.getPropertyKeySet();

                if (proSet != null) {
                    if (proSet.contains(ForwardingProcessorConstants.BLOCKING_SENDER_ERROR)) {
                        proSet.remove(ForwardingProcessorConstants.BLOCKING_SENDER_ERROR);
                    }
                }

                String targetEp =
                        (String) messageContext.getProperty(ForwardingProcessorConstants.TARGET_ENDPOINT);
View Full Code Here

            for (Enumeration f=variable.values().elements();f.hasMoreElements();) {
                Value value = (Value)f.nextElement();
                if (value.equals(assigned)) continue;
                double eval = iValueWeight*value.toDouble() - assignedVal;
                if (acceptConflicts) {
                    Set conflicts = model.conflictValues(value);
                    for (Iterator i=conflicts.iterator();i.hasNext();) {
                        Value conflict = (Value)i.next();
                        eval -= iValueWeight*conflict.toDouble();
                        eval += iConflictWeight * (1.0+(iStat==null?0.0:iStat.countRemovals(solution.getIteration(), conflict, value)));
                    }
                } else {
                    if (model.inConflict(value)) continue;
                }
                if (iTabu!=null && iTabu.contains(tabuElement(value))) {
                    int un = model.nrUnassignedVariables()-(assigned==null?0:1);
                    if (un>model.getBestUnassignedVariables()) continue;
                    if (un==model.getBestUnassignedVariables() && model.getTotalValue()+eval>=solution.getBestValue()) continue;
                }
                if (best==null || bestEval>eval) {
                    if (best==null)
                        best = new Vector();
                    else
                        best.clear();
                    best.add(value);
                    bestEval = eval;
                } else if (bestEval==eval) {
                    best.add(value);
                }
            }
        }
       
        if (best==null) {
            sLog.debug("  [tabu] --none--");
            iFirstIteration=-1;
            if (iTabu!=null) iTabu.clear();
            return null;
        }
        Value bestVal = (Value)ToolBox.random(best);
       
        if (sLog.isDebugEnabled()) {
            Set conflicts = model.conflictValues(bestVal);
            double wconf = (iStat==null?0.0:iStat.countRemovals(solution.getIteration(), conflicts, bestVal));
            sLog.debug("  [tabu] "+bestVal+" ("+(bestVal.variable().getAssignment()==null?"":"was="+bestVal.variable().getAssignment()+", ")+"val="+bestEval+(conflicts.isEmpty()?"":", conf="+(wconf+conflicts.size())+"/"+conflicts)+")");
        }
       
        if (iTabu!=null)
            iTabu.add(tabuElement(bestVal));

View Full Code Here

        //double assignedVal = (assigned==null?-iConflictWeight:iValueWeight*assigned.toDouble());
        double assignedVal = (assigned==null?iConflictWeight:iValueWeight*assigned.toDouble());
        for (Enumeration f=variable.values().elements();f.hasMoreElements();) {
            Value value = (Value)f.nextElement();
            if (value.equals(assigned)) continue;
            Set conflicts = model.conflictValues(value);
            double eval = iValueWeight*value.toDouble() - assignedVal;
            for (Iterator i=conflicts.iterator();i.hasNext();) {
                Value conflict = (Value)i.next();
                eval -= iValueWeight*conflict.toDouble();
                eval += iConflictWeight * (1.0+(iStat==null?0.0:iStat.countRemovals(solution.getIteration(), conflict, value)));
            }
            if (iTabu!=null && iTabu.contains(tabuElement(value))) {
                //if (model.getTotalValue()+eval>=solution.getBestValue()) continue;
                int un = model.nrUnassignedVariables()-(assigned==null?0:1);
                if (un>model.getBestUnassignedVariables()) continue;
                if (un==model.getBestUnassignedVariables() && model.getTotalValue()+eval>=solution.getBestValue()) continue;
        }
            if (best==null || bestEval>eval) {
                if (best==null)
                    best = new Vector();
                else
                    best.clear();
                best.add(value);
                bestEval = eval;
            } else if (bestEval==eval) {
                best.add(value);
            }
        }
       
        if (best==null) return null;
        Value bestVal = (Value)ToolBox.random(best);
       
        if (sLog.isDebugEnabled()) {
            Set conflicts = model.conflictValues(bestVal);
            double wconf = (iStat==null?0.0:iStat.countRemovals(solution.getIteration(), conflicts, bestVal));
            sLog.debug("  [tabu] "+bestVal+" ("+(bestVal.variable().getAssignment()==null?"":"was="+bestVal.variable().getAssignment()+", ")+"val="+bestEval+(conflicts.isEmpty()?"":", conf="+(wconf+conflicts.size())+"/"+conflicts)+")");
        }
       
        if (iTabu!=null) iTabu.add(tabuElement(bestVal));
       
        return bestVal;
View Full Code Here

            }
            synCtx.setTo(to);
            if(isSessionAffinityBasedLB()){
                //We are sending the this message on a new session,
                // hence we need to remove previous session information
                Set pros = synCtx.getPropertyKeySet();
                if (pros != null) {
                    pros.remove(SynapseConstants.PROP_SAL_CURRENT_SESSION_INFORMATION);
                }
            }
            sendToApplicationMember(synCtx, currentMember, true);
        }
View Full Code Here

        + "Explorer.props";
      BufferedInputStream bi = new BufferedInputStream(new FileInputStream(explorerProps));
      expProps.load(bi);
      bi.close();
      bi = null;
      Set keys = expProps.keySet();
      Iterator keysI = keys.iterator();
      while (keysI.hasNext()) {
        String key = (String)keysI.next();
        if (!key.endsWith("Policy")) {
          // See if this key is in the Explorer props
          String existingVal = ExplorerDefaults.get(key, "");
View Full Code Here

      expProps.load(bi);
      bi.close();
      bi = null;
      Properties GPCInputProps = GenericPropertiesCreator.getGlobalInputProperties();
     
      Set keys = expProps.keySet();
      Iterator keysI = keys.iterator();
      while (keysI.hasNext()) {
        String key = (String)keysI.next();
        // see if this key is in the GPC input props
        String existingVal = GPCInputProps.getProperty(key, "");
        if (existingVal.length() > 0) {
View Full Code Here

TOP

Related Classes of java.util.Set

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.