本文整理汇总了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);
}
}
示例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();
}
}
}
}
示例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());
}
示例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);
}
示例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);
}
示例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();
}
示例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;
}
示例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();
}
示例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;
}
示例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);
}
示例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);
}
示例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());
}
示例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();
}
示例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;
}
示例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);
}