C# Class Theraot.Collections.ThreadSafe.NeedleBucket

Inheritance: IBucket
Show file Open project: pocketgems/Theraot

Public Methods

Method Description
CopyTo ( Array array, int arrayIndex ) : void

Copies the items to a compatible one-dimensional array, starting at the specified index of the target array.

Exchange ( int index, item, &previous ) : bool

Sets the item at the specified index.

ExchangeNeedle ( int index, needle, &previous ) : bool

Sets the needle at the specified index.

Get ( int index ) : T

Retrieve or creates a new item at the specified index.

GetEnumerator ( ) : IEnumerator

Returns an enumerator that iterates through a collection.

GetNeedle ( int index ) : TNeedle

Retrieve or creates a new needle at the specified index.

Insert ( int index, item ) : bool

Inserts the item at the specified index.

The insertion can fail if the index is already used or is being written by another thread. If the index is being written it can be understood that the insert operation happened before but the item was overwritten or removed.

Insert ( int index, item, &previous ) : bool

Inserts the item at the specified index.

The insertion can fail if the index is already used or is being written by another thread. If the index is being written it can be understood that the insert operation happened before but the item was overwritten or removed.

InsertNeedle ( int index, needle ) : bool

Inserts the needle at the specified index.

The insertion can fail if the index is already used or is being written by another thread. If the index is being written it can be understood that the insert operation happened before but the needle was overwritten or removed.

InsertNeedle ( int index, needle, &previous ) : bool

Inserts the needle at the specified index.

The insertion can fail if the index is already used or is being written by another thread. If the index is being written it can be understood that the insert operation happened before but the needle was overwritten or removed.

NeedleBucket ( Converter valueFactory, int capacity ) : System

Initializes a new instance of the NeedleBucket{T, TNeedle} class.

NeedleBucket ( Converter valueFactory, int capacity, IEqualityComparer comparer ) : System

Initializes a new instance of the NeedleBucket{T, TNeedle} class.

NeedleBucket ( Func valueFactory, int capacity ) : System

Initializes a new instance of the NeedleBucket{T, TNeedle} class.

NeedleBucket ( Func valueFactory, int capacity, IEqualityComparer comparer ) : System

Initializes a new instance of the NeedleBucket{T, TNeedle} class.

RemoveAt ( int index ) : bool

Removes the item at the specified index.

RemoveAt ( int index, &previous ) : bool

Removes the item at the specified index.

RemoveAt ( int index, Predicate check ) : bool
RemoveNeedleAt ( int index, &previous ) : bool

Removes the needle at the specified index.

Set ( int index, item, bool &isNew ) : void

Sets the item at the specified index.

SetNeedle ( int index, needle, bool &isNew ) : void

Sets the needle at the specified index.

TryGet ( int index, &value ) : bool

Tries to retrieve the item at the specified index.

TryGetNeedle ( int index, &value ) : bool

Tries to retrieve the needle at the specified index.

Update ( int index, Func itemUpdateFactory, Predicate check, bool &isEmpty ) : bool
Where ( Predicate check ) : IEnumerable

Private Methods

Method Description
System ( ) : System.Collections.IEnumerator

Method Details

CopyTo() public method

Copies the items to a compatible one-dimensional array, starting at the specified index of the target array.
array arrayIndex;Non-negative number is required. array;The array can not contain the number of elements.
public CopyTo ( Array array, int arrayIndex ) : void
array Array The array.
arrayIndex int Index of the array.
return void

Exchange() public method

Sets the item at the specified index.
index;index must be greater or equal to 0 and less than capacity
public Exchange ( int index, item, &previous ) : bool
index int The index.
item The item.
previous The previous item in the specified index.
return bool

ExchangeNeedle() public method

Sets the needle at the specified index.
index;index must be greater or equal to 0 and less than capacity
public ExchangeNeedle ( int index, needle, &previous ) : bool
index int The index.
needle The needle.
previous The previous item in the specified index.
return bool

Get() public method

Retrieve or creates a new item at the specified index.
index;index must be greater or equal to 0 and less than capacity
public Get ( int index ) : T
index int The index.
return T

GetEnumerator() public method

Returns an enumerator that iterates through a collection.
public GetEnumerator ( ) : IEnumerator
return IEnumerator

GetNeedle() public method

Retrieve or creates a new needle at the specified index.
index;index must be greater or equal to 0 and less than capacity
public GetNeedle ( int index ) : TNeedle
index int The index.
return TNeedle

Insert() public method

Inserts the item at the specified index.
The insertion can fail if the index is already used or is being written by another thread. If the index is being written it can be understood that the insert operation happened before but the item was overwritten or removed.
index;index must be greater or equal to 0 and less than capacity.
public Insert ( int index, item ) : bool
index int The index.
item The item.
return bool

Insert() public method

Inserts the item at the specified index.
The insertion can fail if the index is already used or is being written by another thread. If the index is being written it can be understood that the insert operation happened before but the item was overwritten or removed.
index;index must be greater or equal to 0 and less than capacity
public Insert ( int index, item, &previous ) : bool
index int The index.
item The item.
previous The previous item in the specified index.
return bool

InsertNeedle() public method

Inserts the needle at the specified index.
The insertion can fail if the index is already used or is being written by another thread. If the index is being written it can be understood that the insert operation happened before but the needle was overwritten or removed.
index;index must be greater or equal to 0 and less than capacity.
public InsertNeedle ( int index, needle ) : bool
index int The index.
needle The needle.
return bool

InsertNeedle() public method

Inserts the needle at the specified index.
The insertion can fail if the index is already used or is being written by another thread. If the index is being written it can be understood that the insert operation happened before but the needle was overwritten or removed.
index;index must be greater or equal to 0 and less than capacity
public InsertNeedle ( int index, needle, &previous ) : bool
index int The index.
needle The needle.
previous The previous needle in the specified index.
return bool

NeedleBucket() public method

Initializes a new instance of the NeedleBucket{T, TNeedle} class.
public NeedleBucket ( Converter valueFactory, int capacity ) : System
valueFactory Converter The delegate that is invoked to do the lazy initialization of the items given their index.
capacity int The capacity.
return System

NeedleBucket() public method

Initializes a new instance of the NeedleBucket{T, TNeedle} class.
public NeedleBucket ( Converter valueFactory, int capacity, IEqualityComparer comparer ) : System
valueFactory Converter The delegate that is invoked to do the lazy initialization of the items given their index.
capacity int The capacity.
comparer IEqualityComparer The equality comparer
return System

NeedleBucket() public method

Initializes a new instance of the NeedleBucket{T, TNeedle} class.
public NeedleBucket ( Func valueFactory, int capacity ) : System
valueFactory Func The delegate that is invoked to do the lazy initialization of the items.
capacity int The capacity.
return System

NeedleBucket() public method

Initializes a new instance of the NeedleBucket{T, TNeedle} class.
public NeedleBucket ( Func valueFactory, int capacity, IEqualityComparer comparer ) : System
valueFactory Func The delegate that is invoked to do the lazy initialization of the items.
capacity int The capacity.
comparer IEqualityComparer The equality comparer
return System

RemoveAt() public method

Removes the item at the specified index.
index;index must be greater or equal to 0 and less than capacity
public RemoveAt ( int index ) : bool
index int The index.
return bool

RemoveAt() public method

Removes the item at the specified index.
index;index must be greater or equal to 0 and less than capacity
public RemoveAt ( int index, &previous ) : bool
index int The index.
previous The previous item in the specified index.
return bool

RemoveAt() public method

public RemoveAt ( int index, Predicate check ) : bool
index int
check Predicate
return bool

RemoveNeedleAt() public method

Removes the needle at the specified index.
index;index must be greater or equal to 0 and less than capacity
public RemoveNeedleAt ( int index, &previous ) : bool
index int The index.
previous The previous needle in the specified index.
return bool

Set() public method

Sets the item at the specified index.
index;index must be greater or equal to 0 and less than capacity
public Set ( int index, item, bool &isNew ) : void
index int The index.
item The item.
isNew bool if set to true the index was not previously used.
return void

SetNeedle() public method

Sets the needle at the specified index.
index;index must be greater or equal to 0 and less than capacity
public SetNeedle ( int index, needle, bool &isNew ) : void
index int The index.
needle The needle.
isNew bool if set to true the index was not previously used.
return void

TryGet() public method

Tries to retrieve the item at the specified index.
index;index must be greater or equal to 0 and less than capacity
public TryGet ( int index, &value ) : bool
index int The index.
value The value.
return bool

TryGetNeedle() public method

Tries to retrieve the needle at the specified index.
index;index must be greater or equal to 0 and less than capacity
public TryGetNeedle ( int index, &value ) : bool
index int The index.
value The value.
return bool

Update() public method

public Update ( int index, Func itemUpdateFactory, Predicate check, bool &isEmpty ) : bool
index int
itemUpdateFactory Func
check Predicate
isEmpty bool
return bool

Where() public method

public Where ( Predicate check ) : IEnumerable
check Predicate
return IEnumerable