private void readObject(java.io.ObjectInputStream inJ) {//throws IOException, ClassNotFoundException { inJ.defaultReadObject(); maps[0] = new java.util.TreeMap <Object, Object>(comparatorJ); maps[1] = new java.util.TreeMap <Object, Object>(comparatorJ); java.util.Map <Object, Object> map = (java.util.Map <Object, Object>)inJ.readObject(); putAll(map); }
/// <summary> /// Retrieve all the senses that contain this word /// </summary> public static Hashtable GetSensesFromWord(string word) { java.util.TreeMap tmap = _wn.getSensesFromWord(word); java.util.Iterator it = tmap.keySet().iterator(); Hashtable table = new Hashtable(); while (it.hasNext()) { string key = (string)it.next(); java.util.ArrayList jlist = (java.util.ArrayList)tmap.get(key); table.Add(key, HelperUtils.ToArrayList(jlist)); } return(table); }
/* * Gets a map of all available charsets supported by the runtime. * <p> * The returned map contains mappings from canonical names to corresponding * instances of <code>Charset</code>. The canonical names can be considered * as case-insensitive. * * @return an unmodifiable map of all available charsets supported by the * runtime */ public static java.util.SortedMap <String, Charset> availableCharsets() { java.util.Iterator <Charset> it = Charset.builtInProvider.charsets(); java.util.SortedMap <String, Charset> sm = new java.util.TreeMap <String, Charset>(); while (it.hasNext()) { Charset next = it.next(); sm.put(next.name(), next); java.util.Iterator <String> alias = next.aliases().iterator(); while (alias.hasNext()) { sm.put(alias.next(), next); } } return(java.util.Collections <Object> .unmodifiableSortedMap(sm)); }
/** * Remove all mappings from this map. */ public override void clear() { if (fast) { lock (this) { map = new java.util.TreeMap <Object, Object>(); } } else { lock (map) { map.clear(); } } }
/** * Copy all of the mappings from the specified map to this one, replacing * any mappings with the same keys. * * @param in the map whose mappings are to be copied */ public override void putAll(java.util.Map <Object, Object> inJ) { if (fast) { lock (this) { java.util.TreeMap <Object, Object> temp = (java.util.TreeMap <Object, Object>)map.clone(); temp.putAll(inJ); map = temp; } } else { lock (map) { map.putAll(inJ); } } }
public virtual bool retainAll(java.util.Collection <Object> o) { if (root.fast) { lock (root) { java.util.TreeMap <Object, Object> temp = (java.util.TreeMap <Object, Object>)root.map.clone(); bool r = get(temp).retainAll(o); root.map = temp; return(r); } } else { lock (root.map) { return(get(root.map).retainAll(o)); } } }
/** * Remove any mapping for this key, and return any previously * mapped value. * * @param key the key whose mapping is to be removed * @return the value removed, or null */ public override Object remove(Object key) { if (fast) { lock (this) { java.util.TreeMap <Object, Object> temp = (java.util.TreeMap <Object, Object>)map.clone(); Object result = temp.remove(key); map = temp; return(result); } } else { lock (map) { return(map.remove(key)); } } }
public static ArrayList GetWordsFromTerm(string sumoTerm) { ArrayList list = new ArrayList(); if (sumoTerm == null || sumoTerm == "") { return(list); } java.util.TreeMap tmap = _wn.getWordsFromTerm(sumoTerm); if (tmap != null) { java.util.Iterator it = tmap.keySet().iterator(); while (it.hasNext()) { string w = it.next().ToString(); string syn = tmap.get(w).ToString(); Synset synObj = new Synset(syn); Word word = new Word(synObj, w); list.Add(word); } } return(list); }
private void readObject(java.io.ObjectInputStream inJ) { //throws IOException, ClassNotFoundException { inJ.defaultReadObject(); maps[0] = new java.util.TreeMap<Object, Object>(comparatorJ); maps[1] = new java.util.TreeMap<Object, Object>(comparatorJ); java.util.Map<Object, Object> map = (java.util.Map<Object, Object>)inJ.readObject(); putAll(map); }
/** * Construct an empty map with the specified comparator. * * @param comparator the comparator to use for ordering tree elements */ public FastTreeMap(java.util.Comparator <Object> comparator) : base() { this.map = new java.util.TreeMap <Object, Object>(comparator); }
// Constructors // ---------------------------------------------------------------------- /** * Construct a an empty map. */ public FastTreeMap() : base() { this.map = new java.util.TreeMap <Object, Object>(); }
/** * Construct a new map with the same mappings as the specified map, * sorted according to the same ordering * * @param map the map whose mappings are to be copied */ public FastTreeMap(java.util.SortedMap <Object, Object> map) : base() { this.map = new java.util.TreeMap <Object, Object>(map); }