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


Java Entry.getValue方法代碼示例

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


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

示例1: save

import java.util.Map.Entry; //導入方法依賴的package包/類
@Override
public IStatus save() {
	try {
		final IEclipsePreferences node = InstanceScope.INSTANCE.getNode(QUALIFIER);
		for (final Entry<Binary, URI> entry : getOrCreateState().entrySet()) {
			final URI path = entry.getValue();
			if (null != path) {
				final File file = new File(path);
				if (file.isDirectory()) {
					node.put(entry.getKey().getId(), file.getAbsolutePath());
				}
			} else {
				// Set to default.
				node.put(entry.getKey().getId(), "");
			}
		}
		node.flush();
		return OK_STATUS;
	} catch (final BackingStoreException e) {
		final String message = "Unexpected error when trying to persist binary preferences.";
		LOGGER.error(message, e);
		return statusHelper.createError(message, e);
	}
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:25,代碼來源:OsgiBinariesPreferenceStore.java

示例2: processNode

import java.util.Map.Entry; //導入方法依賴的package包/類
@Override
protected void processNode(Node node) {
    if (node instanceof GuardNode) {
        processGuard(node);
    } else if (node instanceof Access) {
        processAccess((Access) node);
    }
    if (node instanceof StateSplit && ((StateSplit) node).stateAfter() != null) {
        nullGuarded.clear();
    } else {
        Iterator<Entry<ValueNode, GuardNode>> it = nullGuarded.entrySet().iterator();
        while (it.hasNext()) {
            Entry<ValueNode, GuardNode> entry = it.next();
            GuardNode guard = entry.getValue();
            if (guard.usages().contains(node)) {
                it.remove();
            }
        }
    }
}
 
開發者ID:arodchen,項目名稱:MaxSim,代碼行數:21,代碼來源:GuardLoweringPhase.java

示例3: showPostParams

import java.util.Map.Entry; //導入方法依賴的package包/類
private static void showPostParams(int requestId, Map<String, Object> params) {
	String message = "Post." + requestId + ".Params:";
	StringBuilder stringBuilder = new StringBuilder();
	stringBuilder.append(message);
	String separator = "&";
	Iterator<Entry<String, Object>> it = params.entrySet().iterator();
	while (it.hasNext()) {
		Entry<String, Object> entry = it.next();
		String key = entry.getKey();
		Object value = entry.getValue();

		stringBuilder.append(separator);
		stringBuilder.append(String.format(Locale.getDefault(), "%s=%s", key, value));
	}
	//將第一個分隔符刪除
	int separatorIndex;
	if ((separatorIndex = stringBuilder.indexOf(separator)) != -1) {
		stringBuilder.deleteCharAt(separatorIndex);
	}
	LogUtils.info(stringBuilder.toString());
}
 
開發者ID:PlutoArchitecture,項目名稱:Pluto-Android,代碼行數:22,代碼來源:ApiClient.java

示例4: delete

import java.util.Map.Entry; //導入方法依賴的package包/類
/**
 * Remove a {@link CatalogType} object from this collection.
 * @param name The name of the object to remove.
 */
public boolean delete(String name) {
    try {
        if (m_items.containsKey(name) == false)
            throw new CatalogException("Catalog item '" + name + "' doesn't exists in " + m_parent);

        m_items.remove(name);

        // update versioning if needed
        updateVersioning();

        // assign a relative index to every child item
        int index = 1;
        for (Entry<String, T> e : m_items.entrySet()) {
            e.getValue().m_relativeIndex = index++;
        }
    } catch (Exception ex) {
        throw new RuntimeException(ex);
    }
    
    m_fastArray = null;
    return (true);
}
 
開發者ID:s-store,項目名稱:s-store,代碼行數:27,代碼來源:CatalogMap.java

示例5: getQueryString

import java.util.Map.Entry; //導入方法依賴的package包/類
private String getQueryString(){
	StringBuilder query = new StringBuilder();
	for(Entry<String,List<String>> param : queryParams.entrySet()){
		String key = param.getKey();
		if(key == null || key.trim().isEmpty()){
			continue;
		}
		String urlEncodedKey = urlEncode(key.trim());
		for(String value : param.getValue()){
			query.append('&').append(urlEncodedKey);
			if(value != null && !value.isEmpty()){
				query.append('=').append(urlEncode(value));
			}
		}
	}
	return "?" + query.substring(1);
}
 
開發者ID:hotpads,項目名稱:datarouter,代碼行數:18,代碼來源:DatarouterHttpRequest.java

示例6: cntByTimeString

import java.util.Map.Entry; //導入方法依賴的package包/類
public String cntByTimeString() {
    DecimalFormat df = new DecimalFormat(DECIMAL_PATTERN);
    List<String> millisStr = new LinkedList<String>();
    
    Iterator <Entry<Integer,Integer>>iter = millisMap.entrySet().iterator();
    while(iter.hasNext()) {
        Entry<Integer,Integer> millisEntry = iter.next();
        Integer bucket = (Integer)millisEntry.getKey();
        Integer bucketCount = (Integer)millisEntry.getValue();
        
        int minMillis = bucket.intValue() * millisPerBucket;
        int maxMillis = (bucket.intValue() + 1) * millisPerBucket;
        
        millisStr.add(
          df.format(minMillis/MILLIS_PER_SECOND)+" s "+
          "- "+
          df.format(maxMillis/MILLIS_PER_SECOND)+" s "+
          "= " + bucketCount);
    }
    return millisStr.toString();
}
 
開發者ID:WillemJiang,項目名稱:acmeair,代碼行數:22,代碼來源:JtlTotals.java

示例7: subMaps

import java.util.Map.Entry; //導入方法依賴的package包/類
public List<StringListMap<T>> subMaps(final int size, boolean perMap) {
    final LinkedList<StringListMap<T>> maps = new LinkedList<StringListMap<T>>();
    int index = 0;
    int count = 0;
    for (final Entry<String, List<T>> entry : entrySet()) {
        for (final T value : entry.getValue()) {
            if (index == maps.size()) {
                maps.add(new StringListMap<T>());
            }
            maps.get(index).add(entry.getKey(), value);
            index = perMap ? (++count / size) : (++index % size);
        }
    }
    return maps;
}
 
開發者ID:aws,項目名稱:aws-sdk-java-v2,代碼行數:16,代碼來源:DynamoDbMapper.java

示例8: servicesByState

import java.util.Map.Entry; //導入方法依賴的package包/類
ImmutableMultimap<State, Service> servicesByState() {
  ImmutableSetMultimap.Builder<State, Service> builder = ImmutableSetMultimap.builder();
  monitor.enter();
  try {
    for (Entry<State, Service> entry : servicesByState.entries()) {
      if (!(entry.getValue() instanceof NoOpService)) {
        builder.put(entry);
      }
    }
  } finally {
    monitor.leave();
  }
  return builder.build();
}
 
開發者ID:paul-hammant,項目名稱:googles-monorepo-demo,代碼行數:15,代碼來源:ServiceManager.java

示例9: getSettingsMap

import java.util.Map.Entry; //導入方法依賴的package包/類
public Map<AbstractParentSettingsSection<?>, Set<String>> getSettingsMap()
{
	Map<AbstractParentSettingsSection<?>, Set<String>> settingsMap = Maps.newHashMap();

	for( Entry<String, Extension> extEntry : settingsExtensions.getExtensionMap().entrySet() )
	{
		Extension settingExt = extEntry.getValue();
		Collection<Parameter> groupParams = settingExt.getParameters("grouping");
		AbstractParentSettingsSection<?> bean = settingsExtensions.getBeanByExtension(settingExt);
		if( !Check.isEmpty(groupParams) )
		{
			for( Parameter groupParam : groupParams )
			{
				Set<String> groups = settingsMap.get(bean);
				if( groups == null )
				{
					groups = Sets.newHashSet();
					settingsMap.put(bean, groups);
				}
				groups.add(groupParam.valueAsString());
			}
		}
		else
		{
			settingsMap.put(bean, new HashSet<String>());
		}
	}

	return settingsMap;
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:31,代碼來源:SettingsSection.java

示例10: write

import java.util.Map.Entry; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private void write(Map<String, MutablePair<String, ?>> map) throws IOException
{
    this.updateIndent(true);
    int keys = map.entrySet().size();
    int k = 0;
    for (Entry<String, MutablePair<String, ?>> entry : map.entrySet())
    {
        k += 1;
        MutablePair<String, ?> pair = entry.getValue();
        String comment = pair.getLeft();
        Map<String, MutablePair<String, ?>> rightMap = (Map<String, MutablePair<String, ?>>) pair.getRight();

        int rightKeys = (rightMap == null) ? 0 : rightMap.size();
        boolean newLine = keys > 3;
        if (comment != null)
        {
            this.writeComment(comment);
        }

        String key = entry.getKey();
        this.writeKey(key);
        if (rightMap != null)
        {
            this.write(rightMap);
        }
        if (newLine)
        {
            this.writeNewLine(false);
        }
    }
    this.writeNewLine(false);
    this.updateIndent(false);
}
 
開發者ID:GotoFinal,項目名稱:diorite-configs-java8,代碼行數:35,代碼來源:CommentsWriter.java

示例11: getChangedTableEntries

import java.util.Map.Entry; //導入方法依賴的package包/類
public Collection<Table> getChangedTableEntries(PartitionPlan other) {
    Set<Table> changed = new HashSet<Table>();
    for (Entry<Table, TableEntry> e : this.table_entries.entrySet()) {
        if (!other.table_entries.containsKey(e.getKey())) {
            changed.add(e.getKey());
        } else {
            TableEntry pe0 = e.getValue();
            TableEntry pe1 = other.table_entries.get(e.getKey());
            if (!pe0.equals(pe1))
                changed.add(e.getKey());
        }
    } // FOR
    return (changed);
}
 
開發者ID:s-store,項目名稱:s-store,代碼行數:15,代碼來源:PartitionPlan.java

示例12: testScanFilter_EXISTS

import java.util.Map.Entry; //導入方法依賴的package包/類
@Test
public void testScanFilter_EXISTS() {
    ScanFilter ScanFilter = new ScanFilter("foo").exists();
    Entry<String, Condition> ddbscanFilter = toAttributeCondition(ScanFilter);
    String ddbscanFilter_attrName = ddbscanFilter.getKey();
    Condition ddbscanFilter_value = ddbscanFilter.getValue();

    Assert.assertEquals("foo", ddbscanFilter_attrName);
    Assert.assertEquals(ComparisonOperator.NOT_NULL, ddbscanFilter_value.comparisonOperator());
    Assert.assertEquals(null, ddbscanFilter_value.attributeValueList());
}
 
開發者ID:aws,項目名稱:aws-sdk-java-v2,代碼行數:12,代碼來源:FilterConditionTest.java

示例13: getHasUnitSubUnUnitTopicList

import java.util.Map.Entry; //導入方法依賴的package包/類
public byte[] getHasUnitSubUnUnitTopicList() {
    TopicList topicList = new TopicList();
    try {
        try {
            this.lock.readLock().lockInterruptibly();
            Iterator<Entry<String, List<QueueData>>> topicTableIt =
                    this.topicQueueTable.entrySet().iterator();
            while (topicTableIt.hasNext()) {
                Entry<String, List<QueueData>> topicEntry = topicTableIt.next();
                String topic = topicEntry.getKey();
                List<QueueData> queueDatas = topicEntry.getValue();
                if (queueDatas != null && queueDatas.size() > 0
                        && !TopicSysFlag.hasUnitFlag(queueDatas.get(0).getTopicSynFlag())
                        && TopicSysFlag.hasUnitSubFlag(queueDatas.get(0).getTopicSynFlag())) {
                    topicList.getTopicList().add(topic);
                }
            }
        }
        finally {
            this.lock.readLock().unlock();
        }
    }
    catch (Exception e) {
        log.error("getAllTopicList Exception", e);
    }

    return topicList.encode();
}
 
開發者ID:y123456yz,項目名稱:reading-and-annotate-rocketmq-3.4.6,代碼行數:29,代碼來源:RouteInfoManager.java

示例14: isPrimitiveTypeMap

import java.util.Map.Entry; //導入方法依賴的package包/類
protected boolean isPrimitiveTypeMap(Object o) {
  if (!(o instanceof Map<?, ?>))
    return false;
  Map<?, ?> m = (Map<?, ?>) o;

  Set<?> eset = m.entrySet();
  for (Object entry : eset) {
    Entry<?, ?> e = (Entry<?, ?>) entry;
    if (e.getValue() != null && !isPrimitiveType(e.getValue().getClass().getName()))
      return false;
  }
  return true;
}
 
開發者ID:twosigma,項目名稱:beaker-notebook-archive,代碼行數:14,代碼來源:BasicObjectSerializer.java

示例15: writeObject

import java.util.Map.Entry; //導入方法依賴的package包/類
/**
 * @serialData Null terminated list of <code>VetoableChangeListeners</code>.
 * <p>
 * At serialization time we skip non-serializable listeners and
 * only serialize the serializable listeners.
 */
private void writeObject(ObjectOutputStream s) throws IOException {
    Hashtable<String, VetoableChangeSupport> children = null;
    VetoableChangeListener[] listeners = null;
    synchronized (this.map) {
        for (Entry<String, VetoableChangeListener[]> entry : this.map.getEntries()) {
            String property = entry.getKey();
            if (property == null) {
                listeners = entry.getValue();
            } else {
                if (children == null) {
                    children = new Hashtable<>();
                }
                VetoableChangeSupport vcs = new VetoableChangeSupport(this.source);
                vcs.map.set(null, entry.getValue());
                children.put(property, vcs);
            }
        }
    }
    ObjectOutputStream.PutField fields = s.putFields();
    fields.put("children", children);
    fields.put("source", this.source);
    fields.put("vetoableChangeSupportSerializedDataVersion", 2);
    s.writeFields();

    if (listeners != null) {
        for (VetoableChangeListener l : listeners) {
            if (l instanceof Serializable) {
                s.writeObject(l);
            }
        }
    }
    s.writeObject(null);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:40,代碼來源:VetoableChangeSupport.java


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