示例#1
0
 /// <summary>
 /// Creates a new multi-dictionary
 /// </summary>
 /// <param name="hashFunction">Hash Function to splut the keys into the buckets</param>
 /// <param name="allowNullKeys">Whether null keys are allowed</param>
 /// <param name="comparer">Comparer used for keys within the binary search trees</param>
 /// <param name="mode">Mode to use for the buckets</param>
 public MultiDictionary(Func <TKey, int> hashFunction, bool allowNullKeys, IComparer <TKey> comparer, MultiDictionaryMode mode)
 {
     this._comparer      = (comparer != null ? comparer : this._comparer);
     this._hashFunc      = (hashFunction != null ? hashFunction : this._hashFunc);
     this._allowNullKeys = allowNullKeys;
     this._dict          = new Dictionary <int, ITree <IBinaryTreeNode <TKey, TValue>, TKey, TValue> >();
     this._mode          = mode;
 }
 /// <summary>
 /// Creates a new Tree Indexed triple collection with the given Indexing options
 /// </summary>
 /// <param name="subjIndex">Whether to create a subject index</param>
 /// <param name="predIndex">Whether to create a predicate index</param>
 /// <param name="objIndex">Whether to create an object index</param>
 /// <param name="subjPredIndex">Whether to create a subject predicate index</param>
 /// <param name="subjObjIndex">Whether to create a subject object index</param>
 /// <param name="predObjIndex">Whether to create a predicate object index</param>
 /// <param name="compoundIndexMode">Mode to use for compound indexes</param>
 public TreeIndexedTripleCollection(bool subjIndex, bool predIndex, bool objIndex, bool subjPredIndex, bool subjObjIndex, bool predObjIndex, MultiDictionaryMode compoundIndexMode)
 {
     if (subjIndex)
     {
         _s = new MultiDictionary <INode, List <Triple> >(new FastVirtualNodeComparer(), MultiDictionaryMode.AVL);
     }
     if (predIndex)
     {
         _p = new MultiDictionary <INode, List <Triple> >(new FastVirtualNodeComparer(), MultiDictionaryMode.AVL);
     }
     if (objIndex)
     {
         _o = new MultiDictionary <INode, List <Triple> >(new FastVirtualNodeComparer(), MultiDictionaryMode.AVL);
     }
     if (subjPredIndex)
     {
         _sp = new MultiDictionary <Triple, List <Triple> >(t => Tools.CombineHashCodes(t.Subject, t.Predicate), false, new SubjectPredicateComparer(new FastVirtualNodeComparer()), compoundIndexMode);
     }
     if (subjObjIndex)
     {
         _so = new MultiDictionary <Triple, List <Triple> >(t => Tools.CombineHashCodes(t.Subject, t.Object), false, new SubjectObjectComparer(new FastVirtualNodeComparer()), compoundIndexMode);
     }
     if (predObjIndex)
     {
         _po = new MultiDictionary <Triple, List <Triple> >(t => Tools.CombineHashCodes(t.Predicate, t.Object), false, new PredicateObjectComparer(new FastVirtualNodeComparer()), compoundIndexMode);
     }
 }
 /// <summary>
 /// Creates a new Tree Indexed triple collection
 /// </summary>
 /// <param name="compoundIndexMode">Mode to use for compound indexes</param>
 public TreeIndexedTripleCollection(MultiDictionaryMode compoundIndexMode)
     : this(true, true, true, Options.FullTripleIndexing, Options.FullTripleIndexing, Options.FullTripleIndexing, compoundIndexMode)
 {
 }
示例#4
0
 /// <summary>
 /// Creates a new multi-dictionary
 /// </summary>
 /// <param name="mode">Mode to use for the buckets</param>
 public MultiDictionary(MultiDictionaryMode mode)
     : this(null, false, null, mode)
 {
 }
示例#5
0
 /// <summary>
 /// Creates a new multi-dictionary
 /// </summary>
 /// <param name="comparer">Comparer used for keys within the binary search trees</param>
 /// <param name="mode">Mode to use for the buckets</param>
 public MultiDictionary(IComparer <TKey> comparer, MultiDictionaryMode mode)
     : this(null, false, comparer, mode)
 {
 }
示例#6
0
 /// <summary>
 /// Creates a new multi-dictionary
 /// </summary>
 /// <param name="hashFunction">Hash Function to split the keys into the buckets</param>
 /// <param name="allowNullKeys">Whether to allow null keys</param>
 /// <param name="mode">Mode to use for the buckets</param>
 public MultiDictionary(Func <TKey, int> hashFunction, bool allowNullKeys, MultiDictionaryMode mode)
     : this(hashFunction, allowNullKeys, null, mode)
 {
 }
示例#7
0
 public MultiDictionary(Func <TKey, int> hashFunction, MultiDictionaryMode mode)
     : this(hashFunction, false, null, mode)
 {
 }