Example #1
0
        public static GrowOnlySet <TValue> AddWithReferenceEquality <TKey, TValue>(GrowOnlyHashTable <TKey, GrowOnlySet <TValue> > ht,
                                                                                   TKey key,
                                                                                   TValue value) where TValue : class
        {
            GrowOnlySet <TValue> set = CreateWithReferenceEquality(ht, key);

            set.Insert(value);

            return(set);
        }
Example #2
0
        public static GrowOnlySet <TValue> Add <TKey, TValue>(GrowOnlyHashTable <TKey, GrowOnlySet <TValue> > ht,
                                                              TKey key,
                                                              TValue value)
        {
            GrowOnlySet <TValue> set = Create(ht, key);

            set.Insert(value);

            return(set);
        }
Example #3
0
        //--//

        public static bool CreateWithReferenceEquality <TKey, TValue>(GrowOnlyHashTable <TKey, GrowOnlySet <TValue> > ht,
                                                                      TKey key,
                                                                      out GrowOnlySet <TValue> set) where TValue : class
        {
            if (ht.TryGetValue(key, out set) == false)
            {
                set = SetFactory.NewWithReferenceEquality <TValue>( );

                ht[key] = set;

                return(false);
            }

            return(true);
        }
Example #4
0
        public static bool Create <TKey, TValue>(GrowOnlyHashTable <TKey, GrowOnlySet <TValue> > ht,
                                                 TKey key,
                                                 out GrowOnlySet <TValue> set)
        {
            if (ht.TryGetValue(key, out set) == false)
            {
                set = SetFactory.New <TValue>( );

                ht[key] = set;

                return(false);
            }

            return(true);
        }
Example #5
0
        //
        // Constructor Methods
        //

        protected GenericDepthFirst( )
        {
            m_visited = SetFactory.NewWithReferenceEquality <ITreeNode <FC> >( );
        }