public bool contains(object o) { MapEntry me = (MapEntry)o; object val = mHashMap.mHashTable[me.getKey()]; return(val == me.getValue()); }
public bool remove(object o) { MapEntry me = (MapEntry)o; int count = mHashMap.size(); mHashMap.mHashTable.Remove(me.getKey()); return(count != mHashMap.size()); }
public bool add(object o) { MapEntry me = (MapEntry)o; int count = mHashMap.size(); mHashMap.put(me.getKey(), me.getValue()); return(count != mHashMap.size()); }
public void putAll(Map m) { Set s = m.entrySet(); Iterator i = s.iterator(); while (i.hasNext()) { MapEntry e = (MapEntry)i.next(); putFast(e.getKey(), e.getValue()); } }
public bool removeAll(Collection c) { int count = mHashMap.mHashTable.Count; Iterator i = c.iterator(); while (i.hasNext()) { MapEntry me = (MapEntry)i.next(); mHashMap.mHashTable.Remove(me.getKey()); } return(mHashMap.mHashTable.Count != count); }
public bool retainAll(Collection c) { int count = mHashMap.mHashTable.Count; Iterator i = c.iterator(); while (i.hasNext()) { MapEntry me = (MapEntry)i.next(); object val = mHashMap.mHashTable[me.getKey()]; if (val != me.getValue()) { if (!mHashMap.mHashTable.ContainsKey(me.getKey())) { mHashMap.mHashTable.Add(me.getKey(), me.getValue()); } else { mHashMap.mHashTable.Remove(me.getKey()); } } } return(mHashMap.mHashTable.Count != count); }
public bool containsAll(Collection c) { Iterator i = c.iterator(); while (i.hasNext()) { MapEntry me = (MapEntry)i.next(); if (!mHashMap.mHashTable.ContainsKey(me.getKey())) { return(false); } } return(true); }
public String toString() { Set entries = entrySet(); Iterator entryIter = entries.iterator(); StringBuilder result = new StringBuilder(); while (entryIter.hasNext()) { MapEntry entry = (MapEntry)entryIter.next(); DateTime expireDate = (DateTime)entry.getKey(); MamdaOptionExpirationStrikes strikes = (MamdaOptionExpirationStrikes)entry.getValue(); result.AppendFormat("\n {0}={1}", mDateFormat.Format(expireDate), strikes); } return(result.ToString()); }
private void copyStrikes(SortedMap copy) { // Shallow copy is not good enough. We want a copy that deep // copies the MamdaOptionExpirationStrikes, but not the // contents of those strike sets. DateTime today = DateTime.Today; Set entries = copy.entrySet(); Iterator entryIter = entries.iterator(); while (entryIter.hasNext()) { MapEntry entry = (MapEntry)entryIter.next(); DateTime expireDate = (DateTime)entry.getKey(); // Need to uncomment the following when we have a newer playback file // to properly test with! // if (expireDate > today) { MamdaOptionExpirationStrikes strikes = (MamdaOptionExpirationStrikes)entry.getValue(); put(expireDate, new MamdaOptionExpirationStrikes(strikes)); } } }
internal bool ContainsEntry(MapEntry entry) { Node node = FindNode(entry.getKey()); return node != null && node.Value.Equals(entry.getValue()); }