當前位置: 首頁>>代碼示例>>Java>>正文


Java Map.values方法代碼示例

本文整理匯總了Java中java.util.Map.values方法的典型用法代碼示例。如果您正苦於以下問題:Java Map.values方法的具體用法?Java Map.values怎麽用?Java Map.values使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.util.Map的用法示例。


在下文中一共展示了Map.values方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getCustomerSubscriptions

import java.util.Map; //導入方法依賴的package包/類
/**
 * It returns a list of VOSubscriptionIdAndOrganizations objects, which
 * contain the subscriptionIdentifier and the associated customers of the
 * subscription in form of list.If there are no subscriptions an empty list
 * is returned.
 * 
 * The role of organization as a supplier, a broker or a reseller is needed
 * to execute this method.
 * 
 * @return List<VOSubscriptionIdAndOrganizations>
 */
@Override
@RolesAllowed({ "SERVICE_MANAGER", "BROKER_MANAGER", "RESELLER_MANAGER" })
public List<VOSubscriptionIdAndOrganizations> getCustomerSubscriptions()
        throws OrganizationAuthoritiesException {
    Set<SubscriptionStatus> states = EnumSet.of(SubscriptionStatus.ACTIVE,
            SubscriptionStatus.PENDING);
    LocalizerFacade lf = new LocalizerFacade(localizer,
            dataManager.getCurrentUser().getLocale());

    List<Subscription> queryResultList = getQueryResultListSubIdsAndOrgs(
            states);
    Map<String, VOSubscriptionIdAndOrganizations> mapSubIdsAndOrgs = getSubIdsAndOrgs(
            lf, queryResultList);

    return new ArrayList<>(mapSubIdsAndOrgs.values());
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:28,代碼來源:SubscriptionServiceBean.java

示例2: getToCIRelationsNakedNoAttrs

import java.util.Map; //導入方法依賴的package包/類
/**
 * Gets the to ci relations naked no attrs.
 *
 * @param toId              the to id
 * @param relationName      the relation name
 * @param shortRelationName the short relation name
 * @param fromClazzName     the from clazz name
 * @return the to ci relations naked no attrs
 */
public List<CmsRfcRelation> getToCIRelationsNakedNoAttrs(long toId,
                                                         String relationName, String shortRelationName, String fromClazzName) {

    List<CmsCIRelation> cmRelations = cmProcessor.getToCIRelationsNakedNoAttrs(toId, relationName, shortRelationName, fromClazzName);
    List<CmsRfcRelation> rfcRelations = (fromClazzName != null) ?
            rfcProcessor.getOpenToRfcRelationByTargetClazz(toId, relationName, shortRelationName, fromClazzName) : rfcProcessor.getOpenRfcRelationBy2(null, toId, relationName, shortRelationName);

    Map<Long, Relations> relsMap = buildRelationsMap(cmRelations, rfcRelations);
    List<CmsRfcRelation> result = new ArrayList<>();
    for (Relations rels : relsMap.values()) {
        CmsRfcRelation mergedRel = rfcUtil.mergeRfcRelAndCiRel(rels.getRfcRelation(), rels.getCiRelation(), "df");
        if (mergedRel != null) {
            result.add(mergedRel);
        }
    }
    return result;
}
 
開發者ID:oneops,項目名稱:oneops,代碼行數:27,代碼來源:CmsCmRfcMrgProcessor.java

示例3: getExporter

import java.util.Map; //導入方法依賴的package包/類
static Exporter<?> getExporter(Map<String, Exporter<?>> map, URL key) {
    Exporter<?> result = null;

    if (!key.getServiceKey().contains("*")) {
        result = map.get(key.getServiceKey());
    } else {
        if (map != null && !map.isEmpty()) {
            for (Exporter<?> exporter : map.values()) {
                if (UrlUtils.isServiceKeyMatch(key, exporter.getInvoker().getUrl())) {
                    result = exporter;
                    break;
                }
            }
        }
    }

    if (result == null) {
        return null;
    } else if (ProtocolUtils.isGeneric(
        result.getInvoker().getUrl().getParameter(Constants.GENERIC_KEY))) {
        return null;
    } else {
        return result;
    }
}
 
開發者ID:yunhaibin,項目名稱:dubbox-hystrix,代碼行數:26,代碼來源:InjvmProtocol.java

示例4: getEntryPoints

import java.util.Map; //導入方法依賴的package包/類
private static BitSet getEntryPoints(MethodNode asmNode, Map<AbstractInsnNode, int[]> exitPoints) {
	InsnList il = asmNode.instructions;
	BitSet entryPoints = new BitSet(il.size());

	for (int[] eps : exitPoints.values()) {
		if (eps != null) {
			for (int ep : eps) entryPoints.set(ep);
		}
	}

	for (TryCatchBlockNode n : asmNode.tryCatchBlocks) {
		entryPoints.set(il.indexOf(n.handler));
	}

	return entryPoints;
}
 
開發者ID:sfPlayer1,項目名稱:Matcher,代碼行數:17,代碼來源:Analysis.java

示例5: getToCIRelationsNaked

import java.util.Map; //導入方法依賴的package包/類
/**
 * Gets the to ci relations naked.
 *
 * @param toId              the to id
 * @param relationName      the relation name
 * @param shortRelationName the short relation name
 * @param fromClazzName     the from clazz name
 * @return the to ci relations naked
 */
public List<CmsRfcRelation> getToCIRelationsNaked(long toId,
                                                  String relationName, String shortRelationName, String fromClazzName) {

    List<CmsCIRelation> cmRelations = cmProcessor.getToCIRelationsNaked(toId, relationName, shortRelationName, fromClazzName);
    List<CmsRfcRelation> rfcRelations = (fromClazzName != null) ?
            rfcProcessor.getOpenToRfcRelationByTargetClazz(toId, relationName, shortRelationName, fromClazzName) : rfcProcessor.getOpenRfcRelationBy2(null, toId, relationName, shortRelationName);

    Map<Long, Relations> relsMap = buildRelationsMap(cmRelations, rfcRelations);
    List<CmsRfcRelation> result = new ArrayList<>();
    for (Relations rels : relsMap.values()) {
        CmsRfcRelation mergedRel = rfcUtil.mergeRfcRelAndCiRel(rels.getRfcRelation(), rels.getCiRelation(), "df");
        if (mergedRel != null) {
            result.add(mergedRel);
        }
    }
    return result;
}
 
開發者ID:oneops,項目名稱:oneops,代碼行數:27,代碼來源:CmsCmRfcMrgProcessor.java

示例6: getAllParametersForTest

import java.util.Map; //導入方法依賴的package包/類
public Map<String, String> getAllParametersForTest(String testName)
{
    ITestContext overview = null;

    for (ISuite suite : suites)
    {
        Map<String, ISuiteResult> tests = suite.getResults();

        for (ISuiteResult r : tests.values())
        {
            overview = r.getTestContext();

            if (testName.equalsIgnoreCase(overview.getName()))
            {
                return overview.getCurrentXmlTest().getAllParameters();
            }
        }
    }

    return null;
}
 
開發者ID:pradeeptaswain,項目名稱:oldmonk,代碼行數:22,代碼來源:ReporterAPI.java

示例7: execute

import java.util.Map; //導入方法依賴的package包/類
public static void execute(ManagerConnection c, long time) {

        Map<String, UserStat> statMap = UserStatAnalyzer.getInstance().getUserStatMap();
        for (UserStat userStat : statMap.values()) {
            userStat.setSlowTime(time);
        }

        LOGGER.info(String.valueOf(c) + "Reset show  @@sql.slow=" + time + " time success by manager");

        OkPacket ok = new OkPacket();
        ok.setPacketId(1);
        ok.setAffectedRows(1);
        ok.setServerStatus(2);
        ok.setMessage("Reset show  @@sql.slow time success".getBytes());
        ok.write(c);
    }
 
開發者ID:actiontech,項目名稱:dble,代碼行數:17,代碼來源:ReloadSqlSlowTime.java

示例8: separateOnTheirBlocks

import java.util.Map; //導入方法依賴的package包/類
/**
 * Separates the given set into sets where all {@link ControlFlowElement}s of each set have the same containing
 * {@link Block}.
 * <p>
 * Note that the assumption is:<br/>
 * <i>No block can contain more than one single dead code region.</i>
 */
private Collection<Set<ControlFlowElement>> separateOnTheirBlocks(Set<ControlFlowElement> unreachableElems) {
	Map<EObject, Set<ControlFlowElement>> unreachablesMap = new HashMap<>();
	for (ControlFlowElement unreachableElem : unreachableElems) {
		HashSet<ControlFlowElement> moreUnreachableElems = new HashSet<>();
		EObject cfeBlock = getReachableContainer(unreachableElems, unreachableElem, moreUnreachableElems);
		if (cfeBlock == null)
			continue;

		if (!unreachablesMap.containsKey(cfeBlock)) {
			unreachablesMap.put(cfeBlock, new HashSet<>());
		}
		Set<ControlFlowElement> unreachableInBlock = unreachablesMap.get(cfeBlock);
		unreachableInBlock.add(unreachableElem);
		unreachableInBlock.addAll(moreUnreachableElems);
	}

	return unreachablesMap.values();
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:26,代碼來源:DeadCodeAnalyser.java

示例9: getRandomNavPoint

import java.util.Map; //導入方法依賴的package包/類
/**
 * @param distance must be &lt;0,1> ... 0 ~ pick from all possible navpoint, 1 ~ pick the furthest navpoint
 * @return
 */
public NavPoint getRandomNavPoint(SPLocation location, double distance) {
	if (distance >= 1) {
		return getFurthestNavPoint(location);
	}
	Map<Double, NavPoint> distances = getNavPointDistancesSwapped(location);
	
	if (distance <= 0) {
		Collection<NavPoint> navPoints = distances.values();
		int num = random.nextInt(navPoints.size());
		Iterator<NavPoint> np = navPoints.iterator();
		for (int i = 0; i < num-1; ++i) {
			np.next();
		}
		return np.next();				
	}
	
	Double[] keys = distances.keySet().toArray(new Double[distances.keySet().size()]);
	Arrays.sort(keys, new Comparator<Double>() {

		@Override
		public int compare(Double o1, Double o2) {
			return Double.compare(o1, o2);
		}
		
	});
	int randomInt = Double.valueOf(Math.round((1-distance)*keys.length)).intValue();
	int index = 0;
	if (randomInt > 1) {
		index = keys.length - 1 - random.nextInt(randomInt);
	} else { 
		index = keys.length - 1;
	}
	if (index < 0) {
		System.out.println("huh");
	}
	NavPoint navPoint = distances.get(keys[index]); 
	return navPoint;						
}
 
開發者ID:kefik,項目名稱:Pogamut3,代碼行數:43,代碼來源:SPStoryPlace.java

示例10: of

import java.util.Map; //導入方法依賴的package包/類
static JavaClasses of(Map<String, JavaClass> classes, ImportContext importContext) {
    CompletionProcess completionProcess = new CompletionProcess(classes.values(), importContext);
    for (JavaClass clazz : new JavaClasses(classes)) {
        completionProcess.completeClass(clazz);
    }
    completionProcess.finish();
    return new JavaClasses(classes);
}
 
開發者ID:TNG,項目名稱:ArchUnit,代碼行數:9,代碼來源:JavaClasses.java

示例11: buildMaxSize

import java.util.Map; //導入方法依賴的package包/類
private int buildMaxSize(Map<Integer, List<NodeInfo>> nodeLevelMap) {
	int maxSize=1;
	for(List<NodeInfo> list:nodeLevelMap.values()){
		if(list.size()>maxSize){
			maxSize=list.size();
		}
	}
	return maxSize;
}
 
開發者ID:youseries,項目名稱:urule,代碼行數:10,代碼來源:ReteNodeLayout.java

示例12: allPartitionsSorted

import java.util.Map; //導入方法依賴的package包/類
public List<TopicPartition> allPartitionsSorted(Map<String, Integer> partitionsPerTopic,
                                                Map<String, Subscription> subscriptions) {
    SortedSet<String> topics = new TreeSet<>();
    for (Subscription subscription : subscriptions.values())
        topics.addAll(subscription.topics());

    List<TopicPartition> allPartitions = new ArrayList<>();
    for (String topic : topics) {
        Integer numPartitionsForTopic = partitionsPerTopic.get(topic);
        if (numPartitionsForTopic != null)
            allPartitions.addAll(AbstractPartitionAssignor.partitions(topic, numPartitionsForTopic));
    }
    return allPartitions;
}
 
開發者ID:YMCoding,項目名稱:kafka-0.11.0.0-src-with-comment,代碼行數:15,代碼來源:RoundRobinAssignor.java

示例13: symmetricJoin

import java.util.Map; //導入方法依賴的package包/類
@Override
public 
<KeyType> 
Processable<Pair<RecordType,RecordType>> 
symmetricJoin( 
		Function<KeyType, RecordType> joinKeyGenerator, 
		final ProcessableCollector<Pair<RecordType, RecordType>> collector) {
	
	Map<KeyType, List<RecordType>> joinKeys = hashRecords(this, joinKeyGenerator);
	
	collector.setResult(createProcessable((Pair<RecordType,RecordType>)null));
	collector.initialise();
	
	for(List<RecordType> block : joinKeys.values()) {
		for(int i = 0; i < block.size(); i++) {
			for(int j = i+1; j<block.size(); j++) {
				if(i!=j) {
					collector.next(new Pair<>(block.get(i), block.get(j)));
				}
			}
		}
	}
	
	collector.finalise();
	
	return collector.getResult();
}
 
開發者ID:olehmberg,項目名稱:winter,代碼行數:28,代碼來源:ProcessableCollection.java

示例14: getCommPointProperties

import java.util.Map; //導入方法依賴的package包/類
/**
 * Method is used get most used CommPoint given an input general properties
 * type map.
 *
 * @param countMap
 * @param maxResult
 * @return
 */
private List<TypeCountData> getCommPointProperties(final Map<String, Map<GeneralTabType, TypeCountData>> countMap, final int maxResult) {
	final List<TypeCountData> countList = new ArrayList<TypeCountData>();
	// if max result is -1, that means that we don't wish to apply the max result parameter.
	for (final Map<GeneralTabType, TypeCountData> value : countMap.values()) {
		if (maxResult == -1 || maxResult > countList.size()) {
			countList.add(value.get(GeneralTabType.TotalCounts));
		} else {
			break; // stop adding values to map.
		}
	}

	Collections.sort(countList);
	return countList;
}
 
開發者ID:orionhealth,項目名稱:rlc-analyser,代碼行數:23,代碼來源:RLCDataAnalyser.java

示例15: findNestedAnnotationsInternal

import java.util.Map; //導入方法依賴的package包/類
private static void findNestedAnnotationsInternal(Object object, String annotationFqn, List<AnnotationMirror> result) {
    Collection<? extends AnnotationValue> annotationValueCollection = null;
    if (object instanceof AnnotationMirror) {
        AnnotationMirror annotationMirror = (AnnotationMirror)object;
        String annotationQualifiedName = getAnnotationQualifiedName(annotationMirror);
        if (annotationQualifiedName.equals(annotationFqn)) {
            result.add(annotationMirror);
        }
        else {
            //prepare to recurse
            Map<? extends ExecutableElement,? extends AnnotationValue> annotationMap = annotationMirror.getElementValues();
            annotationValueCollection = annotationMap.values();
        }
    }
    else if (object instanceof List) {
        //prepare to recurse
        annotationValueCollection = (Collection<? extends AnnotationValue>)object;
    }

    //recurse
    if (annotationValueCollection != null) {
        for (AnnotationValue annotationValue : annotationValueCollection) {
            Object value = annotationValue.getValue();
            findNestedAnnotationsInternal(value, annotationFqn, result);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:28,代碼來源:JpaControllerUtil.java


注:本文中的java.util.Map.values方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。