Interface IArray
An interface representing a read-only linear collection of objects
Inherited Members
Namespace: Couchbase.Lite
Assembly: Couchbase.Lite.dll
Syntax
public interface IArray : IArrayFragment, IEnumerable<object>, IEnumerable
Properties
| Improve this Doc View SourceCount
Gets the number of elements in this array
Declaration
int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceGetArray(Int32)
Gets the value at the given index as a read only array
Declaration
ArrayObject GetArray(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to lookup |
Returns
Type | Description |
---|---|
ArrayObject | The value at the index, or |
GetBlob(Int32)
Gets the value at the given index as a Blob
Declaration
Blob GetBlob(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to lookup |
Returns
Type | Description |
---|---|
Blob | The value at the index, or |
GetBoolean(Int32)
Gets the value at the given index as a System.Boolean
Declaration
bool GetBoolean(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to lookup |
Returns
Type | Description |
---|---|
System.Boolean | The value at the index, or its converted equivalent |
Remarks
Any non-zero object will be treated as true, so don't rely on any sort of parsing
GetDate(Int32)
Gets the value at the given index as a System.DateTimeOffset
Declaration
DateTimeOffset GetDate(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to lookup |
Returns
Type | Description |
---|---|
System.DateTimeOffset | The value at the index, or a default |
GetDictionary(Int32)
Gets the value at the given index as a DictionaryObject
Declaration
DictionaryObject GetDictionary(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to lookup |
Returns
Type | Description |
---|---|
DictionaryObject | The value at the index, or |
GetDouble(Int32)
Gets the value at the given index as a System.Double
Declaration
double GetDouble(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to lookup |
Returns
Type | Description |
---|---|
System.Double | The value at the index, or its converted equivalent |
Remarks
true
will be converted to 1.0, and everything else that
is non-numeric will be 0.0
GetFloat(Int32)
Gets the value at the given index as a System.Single
Declaration
float GetFloat(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to lookup |
Returns
Type | Description |
---|---|
System.Single | The value at the index, or its converted equivalent |
Remarks
true
will be converted to 1.0f, and everything else that
is non-numeric will be 0.0f
GetInt(Int32)
Gets the value at the given index as an System.Int32
Declaration
int GetInt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to lookup |
Returns
Type | Description |
---|---|
System.Int32 | The value at the index, or its converted equivalent |
Remarks
true
will be converted to 1, a System.Double value
will be rounded, and everything else non-numeric will be 0
GetLong(Int32)
Gets the value at the given index as an System.Int64
Declaration
long GetLong(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to lookup |
Returns
Type | Description |
---|---|
System.Int64 | The value at the index, or its converted equivalent |
Remarks
true
will be converted to 1, a System.Double value
will be rounded, and everything else non-numeric will be 0
GetString(Int32)
Gets the value at the given index as a System.String
Declaration
string GetString(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to lookup |
Returns
Type | Description |
---|---|
System.String | The value at the index, or |
GetValue(Int32)
Gets the value at the given index as an untyped object
Declaration
object GetValue(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to lookup |
Returns
Type | Description |
---|---|
System.Object | The value at the index, or |
Remarks
This method should be avoided for numeric types, whose underlying representation is subject to change and thus System.InvalidCastExceptions
ToList()
Converts the contents of the array to a .NET list type
Declaration
List<object> ToList()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.Object> | The contents of the array as a .NET list |