Example #1
0
            public bool contains(object o)
            {
                MapEntry me  = (MapEntry)o;
                object   val = mHashMap.mHashTable[me.getKey()];

                return(val == me.getValue());
            }
Example #2
0
            public bool add(object o)
            {
                MapEntry me    = (MapEntry)o;
                int      count = mHashMap.size();

                mHashMap.put(me.getKey(), me.getValue());
                return(count != mHashMap.size());
            }
Example #3
0
        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());
            }
        }
Example #4
0
            public bool addAll(Collection c)
            {
                int      count = mHashMap.mHashTable.Count;
                Iterator i     = c.iterator();

                while (i.hasNext())
                {
                    MapEntry me = (MapEntry)i.next();
                    mHashMap.mHashTable[me.getKey()] = me.getValue();
                }
                return(mHashMap.mHashTable.Count != count);
            }
Example #5
0
            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 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));
                }
            }
        }
Example #8
0
		internal bool ContainsEntry(MapEntry entry)
		{
			Node node = FindNode(entry.getKey());
			return node != null && node.Value.Equals(entry.getValue());
		}