Exemple #1
0
        /// <summary>
        /// Looks up a value associated with a given key
        /// </summary>
        /// <param name="key">The key</param>
        /// <param name="value">The value associated with this key (out parameter), or the default value if not found</param>
        /// <returns>True if there a value associated with the key was found, false otherwise.</returns>
        public bool TryGetValue(T key, out S value)
        {
            Maplet /*?*/ p      = null;
            bool         foundp = ((object)elems == null ? false : elems.TryGetValue(new Maplet(new Pair <T, S>(key, default(S))), out p));

            value = foundp ? p.d.Second : default(S);
            return(foundp);
        }
Exemple #2
0
            public override bool Equals(Object o)
            {
                Maplet /*?*/ m = o as Maplet;

                if (m == null)
                {
                    return(false);
                }
                return(Object.Equals(this.d.First, m.d.First));
            }
Exemple #3
0
            public int CompareTo(object obj)
            {
                Maplet other = obj as Maplet;

                if ((object)other == null)
                {
                    return(1);
                }
                int f1 = HashAlgorithms.CompareValues(this.d.First, other.d.First);

                if (f1 == 1 || f1 == -1)
                {
                    return(f1);
                }
                return(0);
            }