Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Smooth.Slinq.Collections.Lookup< K, T > Class Template Reference

Represents a list of keys each mapped to a list of values. More...

Inheritance diagram for Smooth.Slinq.Collections.Lookup< K, T >:

Public Member Functions

void Add (K key, T value)
 Appends the specified value to the value list for the specified key. If the key was previously unmapped it is appended to the key list. More...
 
void Add (K key, Linked< T > value)
 Appends the specified value to the value list for the specified key. If the key was previously unmapped it is appended to the key list. More...
 
void Add (K key, LinkedHeadTail< T > values)
 Appends the specified list to the value list for the specified key. If the key was previously unmapped it is appended to the key list. More...
 
void Dispose ()
 Releases the lookup and any key and/or value nodes it contains to their respective pools. More...
 
void DisposeInBackground ()
 Relinquishes ownership of the lookup and adds it to the disposal queue. More...
 
LinkedHeadTail< T > FlattenAndDispose ()
 Returns a list of all the values contained in this lookup and adds the lookup to the disposal queue. More...
 
LinkedHeadTail< T > GetValues (K key)
 Returns the list of values for the specified key, without transfer of ownership. More...
 
Slinq< U, GroupJoinContext< U,
K, T, T2, C2 > > 
GroupJoinAndDispose< U, T2, C2 > (Slinq< T2, C2 > outer, DelegateFunc< T2, K > outerSelector, DelegateFunc< T2, Slinq< T, LinkedContext< T >>, U > resultSelector)
 Returns a Slinq that enumerates a group join of the lookup with the specified Slinq using the specified selectors. More...
 
Slinq< U, GroupJoinContext< U,
K, T, T2, C2, P > > 
GroupJoinAndDispose< U, T2, C2, P > (Slinq< T2, C2 > outer, DelegateFunc< T2, P, K > outerSelector, DelegateFunc< T2, Slinq< T, LinkedContext< T >>, P, U > resultSelector, P parameter)
 Returns a Slinq that enumerates a group join of the lookup with the specified Slinq using the specified selectors. More...
 
Slinq< U, GroupJoinContext< U,
K, T, T2, C2 > > 
GroupJoinAndKeep< U, T2, C2 > (Slinq< T2, C2 > outer, DelegateFunc< T2, K > outerSelector, DelegateFunc< T2, Slinq< T, LinkedContext< T >>, U > resultSelector)
 Returns a Slinq that enumerates a group join of the lookup with the specified Slinq using the specified selectors. More...
 
Slinq< U, GroupJoinContext< U,
K, T, T2, C2, P > > 
GroupJoinAndKeep< U, T2, C2, P > (Slinq< T2, C2 > outer, DelegateFunc< T2, P, K > outerSelector, DelegateFunc< T2, Slinq< T, LinkedContext< T >>, P, U > resultSelector, P parameter)
 Returns a Slinq that enumerates a group join of the lookup with the specified Slinq using the specified selectors. More...
 
Slinq< U, JoinContext< U, K, T,
T2, C2 > > 
JoinAndDispose< U, T2, C2 > (Slinq< T2, C2 > outer, DelegateFunc< T2, K > outerSelector, DelegateFunc< T2, T, U > resultSelector)
 Returns a Slinq that enumerates an inner join of the lookup with the specified Slinq using the specified selectors. More...
 
Slinq< U, JoinContext< U, K, T,
T2, C2, P > > 
JoinAndDispose< U, T2, C2, P > (Slinq< T2, C2 > outer, DelegateFunc< T2, P, K > outerSelector, DelegateFunc< T2, T, P, U > resultSelector, P parameter)
 Returns a Slinq that enumerates an inner join of the lookup with the specified Slinq using the specified selectors. More...
 
Slinq< U, JoinContext< U, K, T,
T2, C2 > > 
JoinAndKeep< U, T2, C2 > (Slinq< T2, C2 > outer, DelegateFunc< T2, K > outerSelector, DelegateFunc< T2, T, U > resultSelector)
 Returns a Slinq that enumerates an inner join of the lookup with the specified Slinq using the specified selectors. More...
 
Slinq< U, JoinContext< U, K, T,
T2, C2, P > > 
JoinAndKeep< U, T2, C2, P > (Slinq< T2, C2 > outer, DelegateFunc< T2, P, K > outerSelector, DelegateFunc< T2, T, P, U > resultSelector, P parameter)
 Returns a Slinq that enumerates an inner join of the lookup with the specified Slinq using the specified selectors. More...
 
LinkedHeadTail< T > RemoveValues (K key)
 Returns the list of values for the specified key with ownership of the nodes transferred to the caller. More...
 
Slinq< Grouping< K, T,
LinkedContext< T >
>, GroupByContext< K, T > > 
SlinqAndDispose ()
 Returns a Slinq that enumerates the key, value groupings contained in the lookup, with the values returned in Slinq form. More...
 
Slinq< Grouping< K, T,
LinkedContext< T >
>, GroupByContext< K, T > > 
SlinqAndKeep ()
 Returns a Slinq that enumerates the key, value groupings contained in the lookup, with the values returned in Slinq form. More...
 
Slinq< Grouping< K, T >
, GroupByContext< K, T > > 
SlinqLinkedAndDispose ()
 Returns a Slinq that enumerates the key, value groupings contained in the lookup, with the values returned in Linked form. More...
 
Slinq< Grouping< K, T >
, GroupByContext< K, T > > 
SlinqLinkedAndKeep ()
 Returns a Slinq that enumerates the key, value groupings contained in the lookup, with the values returned in Linked form. More...
 
Lookup< K, T > SortKeys (Comparison< K > comparison, bool ascending)
 Sorts the lookup's keys using the specified comparison and ordering. More...
 

Static Public Member Functions

static Lookup< K, T > Borrow (IEqualityComparer< K > comparer)
 Returns a pooled lookup for the specified comparer. More...
 

Public Attributes

readonly Dictionary< K,
LinkedHeadTail< T > > 
dictionary
 The dictionary used to map keys to lists of values. More...
 
LinkedHeadTail< K > keys
 The list of keys mapped by the lookup. More...
 

Detailed Description

Represents a list of keys each mapped to a list of values.

Member Function Documentation

void Smooth.Slinq.Collections.Lookup< K, T >.Add ( key,
value 
)
inline

Appends the specified value to the value list for the specified key. If the key was previously unmapped it is appended to the key list.

void Smooth.Slinq.Collections.Lookup< K, T >.Add ( key,
Linked< T >  value 
)
inline

Appends the specified value to the value list for the specified key. If the key was previously unmapped it is appended to the key list.

Calling this method transfers ownership of the specified node and any linked nodes to the lookup.

void Smooth.Slinq.Collections.Lookup< K, T >.Add ( key,
LinkedHeadTail< T >  values 
)
inline

Appends the specified list to the value list for the specified key. If the key was previously unmapped it is appended to the key list.

Calling this method transfers ownership of the nodes in the specified list to the lookup.

static Lookup<K, T> Smooth.Slinq.Collections.Lookup< K, T >.Borrow ( IEqualityComparer< K >  comparer)
inlinestatic

Returns a pooled lookup for the specified comparer.

void Smooth.Slinq.Collections.Lookup< K, T >.Dispose ( )
inline

Releases the lookup and any key and/or value nodes it contains to their respective pools.

void Smooth.Slinq.Collections.Lookup< K, T >.DisposeInBackground ( )
inline

Relinquishes ownership of the lookup and adds it to the disposal queue.

LinkedHeadTail<T> Smooth.Slinq.Collections.Lookup< K, T >.FlattenAndDispose ( )
inline

Returns a list of all the values contained in this lookup and adds the lookup to the disposal queue.

Items in the list will be ordered based on the ordering of the key list, then by the position within value list for the item's key.

Ownership of the returned nodes is transferred to the caller, who is responsible for their disposal.

LinkedHeadTail<T> Smooth.Slinq.Collections.Lookup< K, T >.GetValues ( key)
inline

Returns the list of values for the specified key, without transfer of ownership.

The caller of this method is responsible for mananging the scope of the returned nodes.

Slinq<U, GroupJoinContext<U, K, T, T2, C2> > Smooth.Slinq.Collections.Lookup< K, T >.GroupJoinAndDispose< U, T2, C2 > ( Slinq< T2, C2 >  outer,
DelegateFunc< T2, K >  outerSelector,
DelegateFunc< T2, Slinq< T, LinkedContext< T >>, U >  resultSelector 
)
inline

Returns a Slinq that enumerates a group join of the lookup with the specified Slinq using the specified selectors.

When the enumeration is complete, the lookup and any values it contains are added to the disposal queue.

Slinq<U, GroupJoinContext<U, K, T, T2, C2, P> > Smooth.Slinq.Collections.Lookup< K, T >.GroupJoinAndDispose< U, T2, C2, P > ( Slinq< T2, C2 >  outer,
DelegateFunc< T2, P, K >  outerSelector,
DelegateFunc< T2, Slinq< T, LinkedContext< T >>, P, U >  resultSelector,
parameter 
)
inline

Returns a Slinq that enumerates a group join of the lookup with the specified Slinq using the specified selectors.

When the enumeration is complete, the lookup and any values it contains are added to the disposal queue.

Slinq<U, GroupJoinContext<U, K, T, T2, C2> > Smooth.Slinq.Collections.Lookup< K, T >.GroupJoinAndKeep< U, T2, C2 > ( Slinq< T2, C2 >  outer,
DelegateFunc< T2, K >  outerSelector,
DelegateFunc< T2, Slinq< T, LinkedContext< T >>, U >  resultSelector 
)
inline

Returns a Slinq that enumerates a group join of the lookup with the specified Slinq using the specified selectors.

Ownership of the lookup and any values it contains is retained by the caller.

Slinq<U, GroupJoinContext<U, K, T, T2, C2, P> > Smooth.Slinq.Collections.Lookup< K, T >.GroupJoinAndKeep< U, T2, C2, P > ( Slinq< T2, C2 >  outer,
DelegateFunc< T2, P, K >  outerSelector,
DelegateFunc< T2, Slinq< T, LinkedContext< T >>, P, U >  resultSelector,
parameter 
)
inline

Returns a Slinq that enumerates a group join of the lookup with the specified Slinq using the specified selectors.

Ownership of the lookup and any values it contains is retained by the caller.

Slinq<U, JoinContext<U, K, T, T2, C2> > Smooth.Slinq.Collections.Lookup< K, T >.JoinAndDispose< U, T2, C2 > ( Slinq< T2, C2 >  outer,
DelegateFunc< T2, K >  outerSelector,
DelegateFunc< T2, T, U >  resultSelector 
)
inline

Returns a Slinq that enumerates an inner join of the lookup with the specified Slinq using the specified selectors.

When the enumeration is complete, the lookup and any values it contains are added to the disposal queue.

Slinq<U, JoinContext<U, K, T, T2, C2, P> > Smooth.Slinq.Collections.Lookup< K, T >.JoinAndDispose< U, T2, C2, P > ( Slinq< T2, C2 >  outer,
DelegateFunc< T2, P, K >  outerSelector,
DelegateFunc< T2, T, P, U >  resultSelector,
parameter 
)
inline

Returns a Slinq that enumerates an inner join of the lookup with the specified Slinq using the specified selectors.

When the enumeration is complete, the lookup and any values it contains are added to the disposal queue.

Slinq<U, JoinContext<U, K, T, T2, C2> > Smooth.Slinq.Collections.Lookup< K, T >.JoinAndKeep< U, T2, C2 > ( Slinq< T2, C2 >  outer,
DelegateFunc< T2, K >  outerSelector,
DelegateFunc< T2, T, U >  resultSelector 
)
inline

Returns a Slinq that enumerates an inner join of the lookup with the specified Slinq using the specified selectors.

Ownership of the lookup and any values it contains is retained by the caller.

Slinq<U, JoinContext<U, K, T, T2, C2, P> > Smooth.Slinq.Collections.Lookup< K, T >.JoinAndKeep< U, T2, C2, P > ( Slinq< T2, C2 >  outer,
DelegateFunc< T2, P, K >  outerSelector,
DelegateFunc< T2, T, P, U >  resultSelector,
parameter 
)
inline

Returns a Slinq that enumerates an inner join of the lookup with the specified Slinq using the specified selectors.

Ownership of the lookup and any values it contains is retained by the caller.

LinkedHeadTail<T> Smooth.Slinq.Collections.Lookup< K, T >.RemoveValues ( key)
inline

Returns the list of values for the specified key with ownership of the nodes transferred to the caller.

The caller of this method is responsible for the disposal of the returned nodes.

Slinq<Grouping<K, T, LinkedContext<T> >, GroupByContext<K, T> > Smooth.Slinq.Collections.Lookup< K, T >.SlinqAndDispose ( )
inline

Returns a Slinq that enumerates the key, value groupings contained in the lookup, with the values returned in Slinq form.

As the groupings are enumerated, ownership of the values in each grouping is transferred to the Slinq contained in the grouping.

When the enumeration is complete, the lookup and any unenumerated values it contains are added to the disposal queue.

Slinq<Grouping<K, T, LinkedContext<T> >, GroupByContext<K, T> > Smooth.Slinq.Collections.Lookup< K, T >.SlinqAndKeep ( )
inline

Returns a Slinq that enumerates the key, value groupings contained in the lookup, with the values returned in Slinq form.

Ownership of the lookup and any values it contains is retained by the caller.

Slinq<Grouping<K, T>, GroupByContext<K, T> > Smooth.Slinq.Collections.Lookup< K, T >.SlinqLinkedAndDispose ( )
inline

Returns a Slinq that enumerates the key, value groupings contained in the lookup, with the values returned in Linked form.

As the groupings are enumerated, ownership of the values in each grouping is transferred to the owner of the grouping, who is responsible for their disposal.

When the enumeration is complete, the lookup and any unenumerated values it contains are added to the disposal queue.

Slinq<Grouping<K, T>, GroupByContext<K, T> > Smooth.Slinq.Collections.Lookup< K, T >.SlinqLinkedAndKeep ( )
inline

Returns a Slinq that enumerates the key, value groupings contained in the lookup, with the values returned in Linked form.

Ownership of the lookup and any values it contains is retained by the caller.

Lookup<K, T> Smooth.Slinq.Collections.Lookup< K, T >.SortKeys ( Comparison< K >  comparison,
bool  ascending 
)
inline

Sorts the lookup's keys using the specified comparison and ordering.

This method uses an introspective merge sort algorithm that will optimally sort rather than split lists with 3 or fewer nodes.

Member Data Documentation

readonly Dictionary<K, LinkedHeadTail<T> > Smooth.Slinq.Collections.Lookup< K, T >.dictionary

The dictionary used to map keys to lists of values.

LinkedHeadTail<K> Smooth.Slinq.Collections.Lookup< K, T >.keys

The list of keys mapped by the lookup.


The documentation for this class was generated from the following file: