public OrderedSet() { map = new OrderedMap<E, E>(); }
public OrderedSet(int initialCapacity) { map = new OrderedMap<E, E>(initialCapacity); }
public OrderedSet(int initialCapacity, float loadFactor) { map = new OrderedMap<E, E>(initialCapacity, loadFactor); }
@SuppressWarnings({ "unchecked", "rawtypes" }) public static Map buildOrderedMap(Object ... keyValuePairs) { Map map = new OrderedMap(); if (keyValuePairs.length % 2 != 0) throw new IllegalArgumentException("Invalid numer of arguments. " + "It must be even to represent key-value-pairs"); for (int i = 0; i < keyValuePairs.length; i += 2) map.put(keyValuePairs[i], keyValuePairs[i + 1]); return map; }
public OrderedSet(Collection<E> source) { map = new OrderedMap<E, E>(source.size()); addAll(source); }
@SuppressWarnings({ "unchecked", "rawtypes" }) public static Map<String, String> readProperties(String filename, String encoding) throws IOException { return readProperties(new OrderedMap(), filename, null, encoding); }
public Map<K, V> unmarkedEntries() { Map<K, V> result = new OrderedMap<K, V>(); for (Map.Entry<K, V> entry : realMap.entrySet()) if (!isMarked(entry.getKey())) result.put(entry.getKey(), entry.getValue()); return result; }
public Map<K, V> markedEntries() { Map<K, V> result = new OrderedMap<K, V>(); for (Map.Entry<K, V> entry : realMap.entrySet()) if (isMarked(entry.getKey())) result.put(entry.getKey(), entry.getValue()); return result; }
/** * In case of non-tag tokens or empty tags, an empty map is returned. * @return a map with all attributes of the token. */ @Override public Map<String, String> attributes() { if (attributeMap == null) { attributeMap = new OrderedMap<String, String>(); for (int i = 0; i < attribCount; i++) { String attribName = new String(textBuffer, attribNameFrom[i], attribNameUntil[i] - attribNameFrom[i]); attribName = attribName.intern(); String attribValue = null; if (attribValueFrom[i] >= 0) attribValue = new String(textBuffer, attribValueFrom[i], attribValueUntil[i] - attribValueFrom[i]); attributeMap.put(attribName, attribValue); } } return attributeMap; }
@SuppressWarnings("rawtypes") public static <V> Map<String, V> readProperties( String filename, Converter<Map.Entry, Map.Entry> converter, String encoding) throws IOException { return readProperties(new OrderedMap<String, V>(), filename, converter, encoding); }
/** * @return a map with all attributes of the token. * In case of non-tag tokens or empty tags, an empty map is returned. */ public Map<String, String> attributes() { if (attributeMap == null) { attributeMap = new OrderedMap<String, String>(); for (int i = 0; i < attribCount; i++) { String attribName = new String(textBuffer, attribNameFrom[i], attribNameUntil[i] - attribNameFrom[i]); attribName = attribName.intern(); String attribValue = null; if (attribValueFrom[i] >= 0) attribValue = new String(textBuffer, attribValueFrom[i], attribValueUntil[i] - attribValueFrom[i]); attributeMap.put(attribName, attribValue); } } return attributeMap; }
private void saveState() { try { FileUtil.ensureDirectoryExists(new File(DATABENE_DIRECTORY_NAME)); Map<String, String> props = new OrderedMap<String, String>(); props.put("exclusionPattern", exclusionField.getText()); IOUtil.writeProperties(props, GUI_PROPERTIES_FILE_NAME); } catch (IOException e) { // writing the file failed but isn't tragic } }
protected void init() { this.configuredConverterClasses = new OrderedMap<ConversionTypes, Class<? extends Converter>>(); this.converterPrototypes = new HashMap<ConversionTypes, Converter>(); try { if (IOUtil.isURIAvailable(CUSTOM_SETUP_FILENAME)) { CONFIG_LOGGER.debug("Reading custom converter config: {}", CUSTOM_SETUP_FILENAME); readConfigFile(CUSTOM_SETUP_FILENAME); } readConfigFile(DEFAULT_SETUP_FILENAME); } catch (IOException e) { throw new ConfigurationError("Error reading setup file: " + DEFAULT_SETUP_FILENAME); } }
" FROM USER_OBJECTS WHERE UPPER(OBJECT_TYPE) = 'PACKAGE'"; List<Object[]> pkgInfos = DBUtil.query(query, connection); OrderedMap<String, DBPackage> packages = new OrderedMap<String, DBPackage>(); for (int i = 0; i < pkgInfos.size(); i++) { Object[] pkgInfo = pkgInfos.get(i);