public Set entrySet() { if (entrySet == null) { entrySet = new LinkedHashSet<MapEntry>(); final Collection<PropertyDescriptor> types = feature.getType().getDescriptors(); Name attName; Map attributesMap; for (Iterator<PropertyDescriptor> iterator = types.iterator(); iterator.hasNext(); ) { attName = iterator.next().getName(); attributesMap = new AttributeMap(attName, feature); entrySet.add( new MapEntry<Object, Object>(attName.getLocalPart(), attributesMap)); } } return entrySet; } }
new MapEntry<Object, Object>( "isComplex", property instanceof ComplexAttribute)); entrySet.add(new MapEntry<Object, Object>("name", attributeName.getLocalPart())); entrySet.add( new MapEntry<Object, Object>("namespace", getNamespace(attributeName))); entrySet.add(new MapEntry<Object, Object>("prefix", getPrefix(attributeName))); new MapEntry<Object, Object>( "type", buildType((ComplexType) attributeDescr.getType()))); } else { entrySet.add( new MapEntry<Object, Object>( "type", attributeDescr.getType().getBinding().getName())); Geometry.class.isAssignableFrom(attributeDescr.getType().getBinding()); entrySet.add( new MapEntry<Object, Object>("isGeometry", Boolean.valueOf(isGeometry))); entrySet.add(new MapEntry<Object, Object>("rawValue", rawValue));
/** Returns a set view of the mappings contained in this map. */ @Override public Set<Entry<String, Object>> entrySet() { if (entries == null) { entries = new HashSet<Entry<String, Object>>(Math.round(KEYS.length / 0.75f) + 1, 0.75f); for (int i = 0; i < KEYS.length; i++) { final Object value = get(i); if (value != null) { entries.add(new MapEntry<String, Object>(KEYS[i], value)); } } entries = Collections.unmodifiableSet(entries); } return entries; } }
/** * Set {@link #entry} to the next entry to iterate. Returns {@code true} if an entry has * been found, or {@code false} if the iteration is finished. */ @SuppressWarnings("unchecked") private boolean findNext() { while (iterator.hasNext()) { final Map.Entry<K, Object> candidate = iterator.next(); Object value = candidate.getValue(); if (value instanceof Reference) { value = ((Reference<K, V>) value).get(); entry = new MapEntry<K, V>( (K) SoftValueHashMap.resolveNull(candidate.getKey()), (V) value); return true; } if (value != null) { entry = new MapEntry<K, V>( (K) SoftValueHashMap.resolveNull(candidate.getKey()), (V) value); return true; } } return false; }
/** * @return a List of possible workspace/name pairs, possibly empty if the input could not be * decoded; */ public static List<MapEntry<String, String>> decode(String qualifiedName) { int lastPos = qualifiedName.lastIndexOf(DELIMITER); List<MapEntry<String, String>> ret = new ArrayList<MapEntry<String, String>>(); if (lastPos == -1) { ret.add(new MapEntry<String, String>(null, qualifiedName)); return ret; } while (lastPos > -1) { String ws = qualifiedName.substring(0, lastPos); String name = qualifiedName.substring(lastPos + DELIMITER.length()); ret.add(new MapEntry<String, String>(ws, name)); lastPos = qualifiedName.lastIndexOf(DELIMITER, lastPos - 1); } return ret; } }
/** * @return a List of possible workspace/name pairs, possibly empty if the input could not be * decoded; */ public static List<MapEntry<String, String>> decode(String qualifiedName) { int lastPos = qualifiedName.lastIndexOf(DELIMITER); List<MapEntry<String, String>> ret = new ArrayList<MapEntry<String, String>>(); if (lastPos == -1) { ret.add(new MapEntry<String, String>(null, qualifiedName)); return ret; } while (lastPos > -1) { String ws = qualifiedName.substring(0, lastPos); String name = qualifiedName.substring(lastPos + DELIMITER.length()); ret.add(new MapEntry<String, String>(ws, name)); lastPos = qualifiedName.lastIndexOf(DELIMITER, lastPos - 1); } return ret; } }
/** * Set {@link #entry} to the next entry to iterate. Returns {@code true} if * an entry has been found, or {@code false} if the iteration is finished. */ private boolean findNext() { assert Thread.holdsLock(hash); while (iterator.hasNext()) { final Map.Entry candidate = (Map.Entry) iterator.next(); Object value = candidate.getValue(); if (value instanceof Reference) { value = ((Reference) value).get(); entry = new MapEntry(candidate.getKey(), value); return true; } if (value != null) { entry = candidate; return true; } } return false; }
/** * Set {@link #entry} to the next entry to iterate. Returns {@code true} if * an entry has been found, or {@code false} if the iteration is finished. */ @SuppressWarnings("unchecked") private boolean findNext() { assert Thread.holdsLock(hash); while (iterator.hasNext()) { final Map.Entry<K,Object> candidate = iterator.next(); Object value = candidate.getValue(); if (value instanceof Reference) { value = ((Reference) value).get(); entry = new MapEntry<K,V>(candidate.getKey(), (V) value); return true; } if (value != null) { entry = (Map.Entry<K,V>) candidate; return true; } } return false; }