ProtonNet Server 1.0
An Open Solution for all your socket or web api needs.
Loading...
Searching...
No Matches
XmobiTea.Data.GNArray Class Reference

Represents a generic array data structure with various utility methods. More...

Inheritance diagram for XmobiTea.Data.GNArray:
XmobiTea.Data.GNData< int >

Classes

class  Builder
 A builder class for constructing instances of GNArray. More...
 

Public Member Functions

 GNArray ()
 Initializes a new instance of the GNArray class.
 
void Add (object value)
 Adds an object to the array.
 
ICollection< object > Values ()
 Gets the collection of values in the array.
 
void Clear ()
 Clears all elements from the array.
 
bool Remove (int index)
 Removes an element at the specified index.
 
int Count ()
 Gets the number of elements in the array.
 
T[] ToArray< T > ()
 Converts the array to an array of the specified type.
 
IList< T > ToList< T > ()
 Converts the array to a list of the specified type.
 
override object GetObject (int k)
 Gets the object at the specified index.
 
override object ToData ()
 Converts the array to a data object.
 
override string ToString ()
 Returns a string representation of the array.
 
- Public Member Functions inherited from XmobiTea.Data.GNData< int >
object GetObject (TKey k)
 Abstract method to get an object based on the provided key.
 
object GetObject (TKey k, object defaultValue=null)
 Gets an object associated with the provided key.
 
sbyte GetSByte (TKey k, sbyte defaultValue=0)
 Gets a signed byte value associated with the provided key.
 
byte GetByte (TKey k, byte defaultValue=0)
 Gets a byte value associated with the provided key.
 
short GetShort (TKey k, short defaultValue=0)
 Gets a short value associated with the provided key.
 
ushort GetUShort (TKey k, ushort defaultValue=0)
 Gets an unsigned short value associated with the provided key.
 
int GetInt (TKey k, int defaultValue=0)
 Gets an int value associated with the provided key.
 
uint GetUInt (TKey k, uint defaultValue=0)
 Gets an unsigned int value associated with the provided key.
 
float GetFloat (TKey k, float defaultValue=0)
 Gets a float value associated with the provided key.
 
long GetLong (TKey k, long defaultValue=0)
 Gets a long value associated with the provided key.
 
ulong GetULong (TKey k, ulong defaultValue=0)
 Gets an unsigned long value associated with the provided key.
 
double GetDouble (TKey k, double defaultValue=0)
 Gets a double value associated with the provided key.
 
bool GetBool (TKey k, bool defaultValue=false)
 Gets a boolean value associated with the provided key.
 
string GetString (TKey k, string defaultValue=null)
 Gets a string value associated with the provided key.
 
T[] GetArray< T > (TKey k, T[] defaultValue=null)
 Gets an array of a specified type associated with the provided key.
 
System.Collections.Generic.IList< T > GetList< T > (TKey k, System.Collections.Generic.IList< T > defaultValue=null)
 Gets a list of a specified type associated with the provided key.
 
System.Collections.Generic.IDictionary< string, TObject > GetDictionary< TObject > (TKey k, System.Collections.Generic.IDictionary< string, TObject > defaultValue=null)
 Gets a dictionary of a specified type associated with the provided key.
 
GNArray GetGNArray (TKey k, GNArray defaultValue=null)
 Gets a GNArray object associated with the provided key.
 
GNHashtable GetGNHashtable (TKey k, GNHashtable defaultValue=null)
 Gets a GNHashtable object associated with the provided key.
 
object ToData ()
 Abstract method to convert the data to an object.
 

Static Public Member Functions

static Builder NewBuilder ()
 Creates a new instance of the Builder class for building a GNArray.
 

Additional Inherited Members

- Protected Member Functions inherited from XmobiTea.Data.GNData< int >
object CreateUseDataFromOriginData (object value)
 Creates data that can be used from the original data.
 
object CreateDataFromUseData (object value)
 Converts the use data back into its original form.
 
object CustomGet (TKey k)
 Custom method to retrieve an object based on the key and its type.
 

Detailed Description

Represents a generic array data structure with various utility methods.

Member Function Documentation

◆ Add()

void XmobiTea.Data.GNArray.Add ( object value)

Adds an object to the array.

Parameters
valueThe value to add.

◆ Count()

int XmobiTea.Data.GNArray.Count ( )

Gets the number of elements in the array.

Returns
The count of elements in the array.

◆ GetObject()

override object XmobiTea.Data.GNArray.GetObject ( int k)

Gets the object at the specified index.

Parameters
kThe index of the object to retrieve.
Returns
The object at the specified index, or null if the index is out of bounds.

◆ NewBuilder()

static Builder XmobiTea.Data.GNArray.NewBuilder ( )
static

Creates a new instance of the Builder class for building a GNArray.

Returns
A new Builder instance.

◆ Remove()

bool XmobiTea.Data.GNArray.Remove ( int index)

Removes an element at the specified index.

Parameters
indexThe index of the element to remove.
Returns
True if the element was removed successfully; otherwise, false.

◆ ToArray< T >()

T[] XmobiTea.Data.GNArray.ToArray< T > ( )

Converts the array to an array of the specified type.

Template Parameters
TThe type of elements in the resulting array.
Returns
An array of elements of type T .

◆ ToData()

override object XmobiTea.Data.GNArray.ToData ( )

Converts the array to a data object.

Returns
A list of data objects.

◆ ToList< T >()

IList< T > XmobiTea.Data.GNArray.ToList< T > ( )

Converts the array to a list of the specified type.

Template Parameters
TThe type of elements in the resulting list.
Returns
A list of elements of type T .

◆ ToString()

override string XmobiTea.Data.GNArray.ToString ( )

Returns a string representation of the array.

Returns
A string representing the array.

◆ Values()

ICollection< object > XmobiTea.Data.GNArray.Values ( )

Gets the collection of values in the array.

Returns
A collection of objects in the array.

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