fCraft  0.636
Custom Minecraft Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events
Public Member Functions | Public Attributes | Properties | Events | List of all members
fCraft.MetadataCollection< TValue > Class Template Reference

A collection of metadata entries, addressable by pairs of string group/key names. Group names, key names, and values may not be null. More...

Inheritance diagram for fCraft.MetadataCollection< TValue >:
Inheritance graph
[legend]
Collaboration diagram for fCraft.MetadataCollection< TValue >:
Collaboration graph
[legend]

Public Member Functions

 MetadataCollection ()
 Creates an empty MetadataCollection.
 
 MetadataCollection ([NotNull] MetadataCollection< TValue > other)
 Creates a copy of the given MetadataCollection. Copies all entries within.
 
void Add ([NotNull] string group,[NotNull] string key,[NotNull] TValue value)
 Adds a new entry to the collection. Throws ArgumentException if an entry with the same group/key already exists.
 
bool Remove ([NotNull] string group,[NotNull] string key)
 Removes entry with the specified group/key from the collection.
 
int GetKeyCount ([NotNull] string group)
 Number of keys within a given group. Throws KeyNotFoundException if no such group exists.
 
MetadataEntry< TValue > Get ([NotNull] string group,[NotNull] string key)
 
void Set (MetadataEntry< TValue > entry)
 
bool ContainsGroup ([NotNull] string group)
 
bool ContainsKey ([NotNull] string group,[NotNull] string key)
 
bool ContainsValue ([NotNull] TValue value)
 
bool ContainsValue ([NotNull] TValue value, IEqualityComparer< TValue > comparer)
 
bool TryGetValue ([NotNull] string group,[NotNull] string key, out TValue value)
 
IEnumerable< MetadataEntry
< TValue > > 
GetGroup ([NotNull] string group)
 Enumerates a group of keys.
 
void Add (MetadataEntry< TValue > item)
 
void Clear ()
 
bool Contains (MetadataEntry< TValue > item)
 
void CopyTo (MetadataEntry< TValue >[] array, int arrayIndex)
 
bool Remove (MetadataEntry< TValue > item)
 
IEnumerator< MetadataEntry
< TValue > > 
GetEnumerator ()
 Enumerates all keys in this collection.
 
void CopyTo (Array array, int index)
 
object Clone ()
 

Public Attributes

TValue this[[NotNull] string group
 Gets or sets the value of a given entry. If the specified key/value pair is not found, a get operation throws a KeyNotFoundException, and a set operation creates a new element with the specified group/key.
 

Properties

int Count [get]
 The total number of entries in this collection.
 
int GroupCount [get]
 Number of groups in this collection.
 
bool IsSynchronized [get]
 
object SyncRoot [get]
 Internal lock object used by this collection to ensure thread safety.
 

Events

EventHandler Changed
 
- Events inherited from fCraft.INotifiesOnChange
EventHandler Changed
 

Detailed Description

A collection of metadata entries, addressable by pairs of string group/key names. Group names, key names, and values may not be null.

Template Parameters
TValueValue type. Must be a reference type.
Type Constraints
TValue :class 

Constructor & Destructor Documentation

fCraft.MetadataCollection< TValue >.MetadataCollection ( )

Creates an empty MetadataCollection.

fCraft.MetadataCollection< TValue >.MetadataCollection ( [NotNull] MetadataCollection< TValue >  other)

Creates a copy of the given MetadataCollection. Copies all entries within.

Member Function Documentation

void fCraft.MetadataCollection< TValue >.Add ( [NotNull] string  group,
[NotNull] string  key,
[NotNull] TValue  value 
)

Adds a new entry to the collection. Throws ArgumentException if an entry with the same group/key already exists.

Parameters
groupGroup name. Cannot be null.
keyKey name. Cannot be null.
valueValue. Cannot be null.
void fCraft.MetadataCollection< TValue >.Add ( MetadataEntry< TValue >  item)
void fCraft.MetadataCollection< TValue >.Clear ( )
object fCraft.MetadataCollection< TValue >.Clone ( )
bool fCraft.MetadataCollection< TValue >.Contains ( MetadataEntry< TValue >  item)
bool fCraft.MetadataCollection< TValue >.ContainsGroup ( [NotNull] string  group)
bool fCraft.MetadataCollection< TValue >.ContainsKey ( [NotNull] string  group,
[NotNull] string  key 
)
bool fCraft.MetadataCollection< TValue >.ContainsValue ( [NotNull] TValue  value)
bool fCraft.MetadataCollection< TValue >.ContainsValue ( [NotNull] TValue  value,
IEqualityComparer< TValue >  comparer 
)
void fCraft.MetadataCollection< TValue >.CopyTo ( MetadataEntry< TValue >[]  array,
int  arrayIndex 
)
void fCraft.MetadataCollection< TValue >.CopyTo ( Array  array,
int  index 
)
MetadataEntry<TValue> fCraft.MetadataCollection< TValue >.Get ( [NotNull] string  group,
[NotNull] string  key 
)
IEnumerator<MetadataEntry<TValue> > fCraft.MetadataCollection< TValue >.GetEnumerator ( )

Enumerates all keys in this collection.

Lock SyncRoot if this is used in a loop.

IEnumerable<MetadataEntry<TValue> > fCraft.MetadataCollection< TValue >.GetGroup ( [NotNull] string  group)

Enumerates a group of keys.

Lock SyncRoot if this is used in a loop.

int fCraft.MetadataCollection< TValue >.GetKeyCount ( [NotNull] string  group)

Number of keys within a given group. Throws KeyNotFoundException if no such group exists.

Parameters
groupGroup name. Cannot be null.
Returns
Number of keys within the specified group.
bool fCraft.MetadataCollection< TValue >.Remove ( [NotNull] string  group,
[NotNull] string  key 
)

Removes entry with the specified group/key from the collection.

Parameters
groupGroup name. Cannot be null.
keyKey name. Cannot be null.
Returns
True if the entry was located and removed. False if no entry was found.
bool fCraft.MetadataCollection< TValue >.Remove ( MetadataEntry< TValue >  item)
void fCraft.MetadataCollection< TValue >.Set ( MetadataEntry< TValue >  entry)
bool fCraft.MetadataCollection< TValue >.TryGetValue ( [NotNull] string  group,
[NotNull] string  key,
out TValue  value 
)

Member Data Documentation

TValue this[[NotNull] string fCraft.MetadataCollection< TValue >.group

Gets or sets the value of a given entry. If the specified key/value pair is not found, a get operation throws a KeyNotFoundException, and a set operation creates a new element with the specified group/key.

Parameters
groupThe group of the value to get or set.
keyThe key of the value to get or set.

Property Documentation

int fCraft.MetadataCollection< TValue >.Count
get

The total number of entries in this collection.

int fCraft.MetadataCollection< TValue >.GroupCount
get

Number of groups in this collection.

bool fCraft.MetadataCollection< TValue >.IsSynchronized
get
object fCraft.MetadataCollection< TValue >.SyncRoot
get

Internal lock object used by this collection to ensure thread safety.

Event Documentation

EventHandler fCraft.MetadataCollection< TValue >.Changed

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