当前位置: 首页>>代码示例>>Java>>正文


Java Set.iterator方法代码示例

本文整理汇总了Java中java.util.Set.iterator方法的典型用法代码示例。如果您正苦于以下问题:Java Set.iterator方法的具体用法?Java Set.iterator怎么用?Java Set.iterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.Set的用法示例。


在下文中一共展示了Set.iterator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toSimpleItypeConfig

import java.util.Set; //导入方法依赖的package包/类
/**
 * Read persistent class InstrOfferingConfig and convert it to a 
 * representation that can be displayed
 * @param config InstrOfferingConfig object
 * @param subpart Scheduling subpart
 * @return SimpleItypeConfig object representing the subpart
 * @throws Exception
 */
private SimpleItypeConfig toSimpleItypeConfig (
        InstrOfferingConfig config, 
        SchedulingSubpart subpart) throws Exception {
    
    ItypeDesc itype = subpart.getItype();
    SimpleItypeConfig sic = new SimpleItypeConfig(itype);
    
    boolean isDisabled = setSicProps(config, subpart, sic);

    Set s = subpart.getChildSubparts();
    Iterator iter = s.iterator();
    while(iter.hasNext()) {
        SchedulingSubpart child = (SchedulingSubpart) iter.next();
        SimpleItypeConfig childSic = toSimpleItypeConfig(config, child);
        boolean isDisabledChild = setSicProps(config, child, childSic);
        sic.addSubpart(childSic);            
        if(isDisabledChild)
            isDisabled = true;
    }
    
    if (isDisabled)
        sic.setDisabled(true);
    
    return sic;        	
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:34,代码来源:InstructionalOfferingConfigEditAction.java

示例2: run

import java.util.Set; //导入方法依赖的package包/类
public void run()
{
    Set destroyedPOATemplates = new HashSet() ;

    performDestroy( thePoa, destroyedPOATemplates );

    Iterator iter = destroyedPOATemplates.iterator() ;
    ObjectReferenceTemplate[] orts = new ObjectReferenceTemplate[
        destroyedPOATemplates.size() ] ;
    int index = 0 ;
    while (iter.hasNext())
        orts[ index++ ] = (ObjectReferenceTemplate)iter.next();

    thePoa.getORB().getPIHandler().adapterStateChanged( orts,
        NON_EXISTENT.value ) ;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:POAImpl.java

示例3: checkPermittedURI

import java.util.Set; //导入方法依赖的package包/类
private void checkPermittedURI(Set permitted, String uri)
    throws PKIXNameConstraintValidatorException
{
    if (permitted == null)
    {
        return;
    }

    Iterator it = permitted.iterator();

    while (it.hasNext())
    {
        String str = ((String)it.next());

        if (isUriConstrained(uri, str))
        {
            return;
        }
    }
    if (uri.length() == 0 && permitted.size() == 0)
    {
        return;
    }
    throw new PKIXNameConstraintValidatorException(
        "URI is not from a permitted subtree.");
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:27,代码来源:PKIXNameConstraintValidator.java

示例4: getCqMappingString

import java.util.Set; //导入方法依赖的package包/类
/** for debugging we could sometimes use a dump of the Long->cq name table */
private String getCqMappingString() {
  if (cqMap == null) {
    return "";
  }
  Map wids = cqMap.wireIDs;
  if (wids.size() == 0) {
    return "cqs[]";
  }
  Set<Long> sorted = new TreeSet(wids.keySet());
  StringBuffer result = new StringBuffer(sorted.size() * 70);
  result.append("cqs[");
  Iterator<Long> it = sorted.iterator();
  for (int i = 1; it.hasNext(); i++) {
    Long wireID = it.next();
    result.append(wireID).append("={").append(wids.get(wireID)).append('}');
    if (it.hasNext()) {
      result.append(", ");
    }
  }
  result.append("]");
  return result.toString();
}
 
开发者ID:ampool,项目名称:monarch,代码行数:24,代码来源:FilterProfile.java

示例5: print

import java.util.Set; //导入方法依赖的package包/类
public String print() {
    String ret = k + "-RCG:\n";
    ret += "Start predicate: " + getStartPredicateLabel().toString() + "\n";
    Set<PredLabel> hlabels = clausesByLhsLabel.keySet();
    Iterator<PredLabel> it = hlabels.iterator();
    while (it.hasNext()) {
        PredLabel label = (PredLabel) it.next();
        List<Clause> clauseset = clausesByLhsLabel.get(label);
        Iterator<Clause> clauseit = clauseset.iterator();
        while (clauseit.hasNext()) {
            Clause clause = (Clause) clauseit.next();
            int index = clause.getCindex();
            String ind = index + "";
            if (index < 10)
                ind = "00" + ind;
            else if (index < 100)
                ind = "0" + ind;
            ret += "(C_" + ind + ") ";
            ret += clause.print() + "\n";
        }
    }
    ret = ret.trim();
    return ret;
}
 
开发者ID:spetitjean,项目名称:TuLiPA-frames,代码行数:25,代码来源:RCG.java

示例6: addTagForClosingHBox

import java.util.Set; //导入方法依赖的package包/类
private void addTagForClosingHBox(Hashtable<String, PosLineCol> hashPosLineColByLanguage, Hashtable<String, CMapElement> hashMapsByLanguage)
{
	// Enum all Maps in every language and add the item into the map
	Set<Entry<String, CMapElement> > set = hashMapsByLanguage.entrySet();
	Iterator<Entry<String, CMapElement> > iter = set.iterator();
	while(iter.hasNext())
	{
		Entry<String, CMapElement> entry = iter.next();
		String csLg = entry.getKey();
		CMapElement eMap = entry.getValue();
		PosLineCol posLineCol = hashPosLineColByLanguage.get(csLg);

		CFieldElement eField = new CFieldElement("", 0);
		boolean bAdd = eField.setAsClosingHBox(posLineCol);
		if(bAdd)
			eMap.AddElement(eField);
	}
}
 
开发者ID:costea7,项目名称:ChronoBike,代码行数:19,代码来源:BMSTranscoderEngine.java

示例7: debugAttributes

import java.util.Set; //导入方法依赖的package包/类
private void debugAttributes(final Set<Attribute> subjectAttributes, final Set<Attribute> resourceAttributes) {
    if (LOGGER.isDebugEnabled()) {
        StringBuilder sb = new StringBuilder();
        sb.append("Subject Attributes :\n");
        Iterator<Attribute> subjectAttributesItr = subjectAttributes.iterator();
        while (subjectAttributesItr.hasNext()) {
            sb.append(subjectAttributesItr.next().toString() + "\n");
        }
        sb.append("Resource Attributes :\n");
        Iterator<Attribute> resourceAttributesIte = resourceAttributes.iterator();
        while (resourceAttributesIte.hasNext()) {
            sb.append(resourceAttributesIte.next().toString() + "\n");
        }
        LOGGER.debug(sb.toString());
    }
}
 
开发者ID:eclipse,项目名称:keti,代码行数:17,代码来源:PolicyEvaluationServiceImpl.java

示例8: getAlerts

import java.util.Set; //导入方法依赖的package包/类
/**
 * Query all the statistic defined by alert definition and notify alerts aggregator if at least
 * one statistic value crosses the threshold defined in alert definition
 * 
 */
protected StatAlert[] getAlerts() {
  Set alerts = new HashSet();

  synchronized (alertDefinitionsMap) {
    Set keyset = alertDefinitionsMap.keySet();
    Iterator iter = keyset.iterator();
    StatAlert alert;
    Date now = new Date();
    while (iter.hasNext()) {
      Integer key = (Integer) iter.next();
      StatAlertDefinition defn = (StatAlertDefinition) alertDefinitionsMap.get(key);
      alert = defn.evaluateAndAlert();
      if (alert != null) {
        alert.setTime(now);
        alerts.add(alert);
        if (logger.isDebugEnabled()) {
          logger.debug("getAlerts:  found alert {}", alert);
        }
      }
    } // while
  } // synchronized
  return (StatAlert[]) alerts.toArray(new StatAlert[alerts.size()]);
}
 
开发者ID:ampool,项目名称:monarch,代码行数:29,代码来源:StatAlertsManager.java

示例9: createAutoFormHtml

import java.util.Set; //导入方法依赖的package包/类
/**
 * 功能:前台交易构造HTTP POST自动提交表单<br>
 * @param reqUrl 表单提交地址<br>
 * @param hiddens 以MAP形式存储的表单键值<br>
 * @param encoding 上送请求报文域encoding字段的值<br>
 * @return 构造好的HTTP POST交易表单<br>
 */
public static String createAutoFormHtml(String reqUrl, Map<String, String> hiddens,String encoding) {
	StringBuffer sf = new StringBuffer();
	sf.append("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset="+encoding+"\"/></head><body>");
	sf.append("<form id = \"pay_form\" action=\"" + reqUrl
			+ "\" method=\"post\">");
	if (null != hiddens && 0 != hiddens.size()) {
		Set<Entry<String, String>> set = hiddens.entrySet();
		Iterator<Entry<String, String>> it = set.iterator();
		while (it.hasNext()) {
			Entry<String, String> ey = it.next();
			String key = ey.getKey();
			String value = ey.getValue();
			sf.append("<input type=\"hidden\" name=\"" + key + "\" id=\""
					+ key + "\" value=\"" + value + "\"/>");
		}
	}
	sf.append("</form>");
	sf.append("</body>");
	sf.append("<script type=\"text/javascript\">");
	sf.append("document.all.pay_form.submit();");
	sf.append("</script>");
	sf.append("</html>");
	return sf.toString();
}
 
开发者ID:wangfei0904306,项目名称:unionpay,代码行数:32,代码来源:AcpService.java

示例10: garbageCollectorStatementsOptinalResetReservedStatement

import java.util.Set; //导入方法依赖的package包/类
synchronized int garbageCollectorStatementsOptinalResetReservedStatement(boolean bResetReservedStatements)
{
	if(m_hashStatement == null)
		return 0;
	
	int n = 0;
	Set<Map.Entry<String, DbPreparedStatement>> set = m_hashStatement.entrySet();
	Iterator<Map.Entry<String, DbPreparedStatement>> iterMapEntry = set.iterator();
	while(iterMapEntry.hasNext())
	{
		Map.Entry<String, DbPreparedStatement> mapEntry = iterMapEntry.next(); 
		DbPreparedStatement dbPreparedStatement = mapEntry.getValue();
		if(dbPreparedStatement.isTimeOut(m_nMaxStatementLiveTime_ms))
		{
			dbPreparedStatement.close();
			iterMapEntry.remove();
			n++;
		}
		else if(bResetReservedStatements)
			dbPreparedStatement.resetReserved();
	}
	
	return n;
}
 
开发者ID:costea7,项目名称:ChronoBike,代码行数:25,代码来源:DbConnectionBase.java

示例11: getMemBytes

import java.util.Set; //导入方法依赖的package包/类
private long getMemBytes(PartitionedRegion pr) {
  Set<BucketRegion> brs = pr.getDataStore().getAllLocalBucketRegions();

  long bytes = 0;
  for (Iterator<BucketRegion> itr = brs.iterator(); itr.hasNext();) {
    BucketRegion br = itr.next();
    bytes += br.getBytesInMemory();
  }

  return bytes;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:12,代码来源:PartitionedRegionStatsJUnitTest.java

示例12: map2ContentValues

import java.util.Set; //导入方法依赖的package包/类
public static ContentValues map2ContentValues(Map<String, Object> map) {
    ContentValues values = new ContentValues();
    if (map != null && map.size() > 0) {
        Set<Map.Entry<String, Object>> set = map.entrySet();
        Iterator<Map.Entry<String, Object>> itr = set.iterator();
        while (itr.hasNext()) {
            Map.Entry<String, Object> entry = itr.next();
            String key = entry.getKey();
            Object value = entry.getValue();
            if (value != null) {
                if (value instanceof String) {
                    values.put(key, (String) value);
                } else if (value instanceof Integer) {
                    values.put(key, (Integer) value);
                } else if (value instanceof Float) {
                    values.put(key, (Float) value);
                } else {
                    LogUtils.d("未知的参数类型,key:" + key + ",value:" + value);

                }
            } else {
                LogUtils.d("未知的参数类型,key:" + key + ",value:" + value);
            }
        }
    }
    return values;
}
 
开发者ID:jessie345,项目名称:RetrofitAppArchitecture,代码行数:28,代码来源:Utils.java

示例13: checkStringForIngredient

import java.util.Set; //导入方法依赖的package包/类
public static String checkStringForIngredient(String arg, Set<String> ingredients) {
	int best_count = 0;
	String best_ingredient = null;	
	Iterator<String> ingredient_it = ingredients.iterator();
	while (ingredient_it.hasNext()) {
		String ingredient = ingredient_it.next();

		int overlap = Utils.wordOverlapCount(arg, ingredient);
		if (overlap > best_count) {
			best_count = overlap;
			best_ingredient = ingredient;
		}
	}
	return best_ingredient;
}
 
开发者ID:uwnlp,项目名称:recipe-interpretation,代码行数:16,代码来源:IngredientParser.java

示例14: getConnectionAnchorName

import java.util.Set; //导入方法依赖的package包/类
/**
 * Gets the connection anchor name.
 * 
 * @param connectionAnchor
 *            the connectionAnchor
 * @return the connection anchor name
 */
public String getConnectionAnchorName(ConnectionAnchor connectionAnchor) {

	Set<String> keys = connectionAnchors.keySet();
	String key;
	Iterator<String> it = keys.iterator();

	while (it.hasNext()) {
		key = it.next();
		if (connectionAnchors.get(key).equals(connectionAnchor))
			return key;
	}
	return null;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:21,代码来源:ComponentFigure.java

示例15: checkHashMap

import java.util.Set; //导入方法依赖的package包/类
private String checkHashMap(QueryResult other) {
    HashMap<String,Integer> otherMap = other.resultHash;
    String error=null;
    int missing=0;
    int tooMany=0;
    Set<Map.Entry<String, Integer>> keys = otherMap.entrySet();
    Iterator<Map.Entry<String, Integer>> it = keys.iterator();

    while(it.hasNext()) {
        String key = it.next().getKey();
        Integer countO = otherMap.get(key);

        if(resultHash.containsKey(key)) {
            int count = resultHash.get(key);
            if(count<countO)
                missing += countO - count;
            else if(count>countO)
                tooMany += count - countO;
            resultHash.remove(key);
        }
        else {
            missing += countO;
        }

        tooMany += nrResults - tooMany - other.nrResults + missing ;
    }

    if(missing>0)
        error = addError(error, missing + " results are missing. ");

    if(tooMany>0)
        error = addError(error, tooMany + " results are incorrect.\n");

    return error;
}
 
开发者ID:SmartDataAnalytics,项目名称:Embeddable-BSBM,代码行数:36,代码来源:QueryResult.java


注:本文中的java.util.Set.iterator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。