本文整理匯總了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());
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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();
}
示例9: getRandomNavPoint
import java.util.Map; //導入方法依賴的package包/類
/**
* @param distance must be <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;
}
示例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);
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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);
}
}
}