Show / Hide Table of Contents

Class Enumeration

Represents a TileDB enumeration object.

Inheritance
object
Enumeration
Implements
IDisposable
Namespace: TileDB.CSharp
Assembly: TileDB.CSharp.dll
Syntax
public sealed class Enumeration : IDisposable

Fields

| Edit this page View Source

VariableSized

This value indicates an enumeration with variable-sized members. It may be returned from ValuesPerMember.

Declaration
public const uint VariableSized = 4294967295
Field Value
Type Description
uint
See Also
Create<T>(Context, string, bool, ReadOnlySpan<T>, ReadOnlySpan<ulong>, DataType?)

Properties

| Edit this page View Source

DataType

The DataType of the Enumeration.

Declaration
public DataType DataType { get; }
Property Value
Type Description
DataType
| Edit this page View Source

IsOrdered

Whether the Enumeration should be considered as ordered.

Declaration
public bool IsOrdered { get; }
Property Value
Type Description
bool
Remarks

If false, prevents inequality operators in QueryConditions from being used with this enumeration.

| Edit this page View Source

ValuesPerMember

Returns the number of values for each member of the Enumeration.

Declaration
public uint ValuesPerMember { get; }
Property Value
Type Description
uint
Remarks

If this property has a value of VariableSized, each value has a different size.

This method exposes the tiledb_enumeration_get_cell_val_num function of the TileDB Embedded C API.

Methods

| Edit this page View Source

Create(Context, string, bool, IReadOnlyCollection<string>, DataType)

Creates an Enumeration from a collection of strings.

Declaration
public static Enumeration Create(Context ctx, string name, bool ordered, IReadOnlyCollection<string> values, DataType dataType = DataType.StringUtf8)
Parameters
Type Name Description
Context ctx

The Context to use.

string name

The name of the enumeration.

bool ordered

Whether the enumeration should be considered as ordered. If false, prevents inequality operators in QueryConditions from being used with this enumeration.

IReadOnlyCollection<string> values

The collection of values for the enumeration.

DataType dataType

The data type of the enumeration. Must be a string type. Optional, defaults to StringUtf8.

Returns
Type Description
Enumeration
| Edit this page View Source

Create<T>(Context, string, bool, ReadOnlySpan<T>, ReadOnlySpan<ulong>, DataType?)

Creates an Enumeration with variable-sized members.

Declaration
public static Enumeration Create<T>(Context ctx, string name, bool ordered, ReadOnlySpan<T> values, ReadOnlySpan<ulong> offsets, DataType? dataType = null) where T : struct
Parameters
Type Name Description
Context ctx

The Context to use.

string name

The name of the enumeration.

bool ordered

The value of IsOrdered.

ReadOnlySpan<T> values

A ReadOnlySpan<T> of all values of each member of the enumeration, concatenated.

ReadOnlySpan<ulong> offsets

A ReadOnlySpan<T> of the offsets to the first byte of each member of the enumeration.

DataType? dataType

The data type of the enumeration. Defaults to the default data type of T.

Returns
Type Description
Enumeration
Type Parameters
Name Description
T

The type of the enumeration's members.

Exceptions
Type Condition
InvalidOperationException

dataType does not match T.

| Edit this page View Source

Create<T>(Context, string, bool, ReadOnlySpan<T>, uint, DataType?)

Creates an Enumeration with fixed-sized members.

Declaration
public static Enumeration Create<T>(Context ctx, string name, bool ordered, ReadOnlySpan<T> values, uint cellValNum = 1, DataType? dataType = null) where T : struct
Parameters
Type Name Description
Context ctx

The Context to use.

string name

The name of the enumeration.

bool ordered

The value of IsOrdered.

ReadOnlySpan<T> values

A ReadOnlySpan<T> of the enumeration's values.

uint cellValNum

The number of values per member in the enumeration. Optional, defaults to 1. If specified, its value must divide the length of values.

DataType? dataType

The data type of the enumeration. Defaults to the default data type of T.

Returns
Type Description
Enumeration
Type Parameters
Name Description
T

The type of the enumeration's members.

Exceptions
Type Condition
InvalidOperationException

dataType does not match T.

| Edit this page View Source

Dispose()

Disposes the Enumeration.

Declaration
public void Dispose()
| Edit this page View Source

Extend(IReadOnlyCollection<string>)

Extends an Enumeration of strings.

Declaration
public Enumeration Extend(IReadOnlyCollection<string> values)
Parameters
Type Name Description
IReadOnlyCollection<string> values

The strings to add to the enumeration.

Returns
Type Description
Enumeration
Exceptions
Type Condition
InvalidOperationException

The enumeration has a non-string data type, or its members are fixed-size.

| Edit this page View Source

Extend<T>(ReadOnlySpan<T>)

Adds additional values to an Enumeration with fixed-sized members.

Declaration
public Enumeration Extend<T>(ReadOnlySpan<T> values) where T : struct
Parameters
Type Name Description
ReadOnlySpan<T> values

A ReadOnlySpan<T> of the enumeration's values.

Returns
Type Description
Enumeration
Type Parameters
Name Description
T

The type of the enumeration's members.

Exceptions
Type Condition
InvalidOperationException

The enumeration's DataType does not match T.

| Edit this page View Source

Extend<T>(ReadOnlySpan<T>, ReadOnlySpan<ulong>)

Extends an Enumeration with variable-sized members.

Declaration
public Enumeration Extend<T>(ReadOnlySpan<T> values, ReadOnlySpan<ulong> offsets) where T : struct
Parameters
Type Name Description
ReadOnlySpan<T> values

A ReadOnlySpan<T> of all values of each additional member of the enumeration, concatenated.

ReadOnlySpan<ulong> offsets

A ReadOnlySpan<T> of the offsets to the first byte of each member of the enumeration.

Returns
Type Description
Enumeration
Type Parameters
Name Description
T

The type of the enumeration's members.

Exceptions
Type Condition
InvalidOperationException

The enumeration's DataType does not match T.

| Edit this page View Source

GetName()

Returns the name of the Enumeration.

Declaration
public string GetName()
Returns
Type Description
string
| Edit this page View Source

GetRawData()

Returns a byte array with the raw data of the Enumeration's members.

Declaration
public byte[] GetRawData()
Returns
Type Description
byte[]
See Also
GetValues()
GetRawOffsets()
| Edit this page View Source

GetRawOffsets()

Returns an array with the offsets to the first byte of each member of the Enumeration.

Declaration
public ulong[] GetRawOffsets()
Returns
Type Description
ulong[]
Remarks

In enumerations with fixed-size members (i.e. ValuesPerMember is not equal to VariableSized, this method will return an empty array, as each member has the same size.

See Also
GetValues()
GetRawData()
| Edit this page View Source

GetValues()

Returns the values of the Enumeration.

Declaration
public Array GetValues()
Returns
Type Description
Array

An array whose type depends on the enumeration's DataType and ValuesPerMember:

  • If DataType is a string datatype, the method will return an array of string.
  • If the enumeration's values have a fixed size (i.e. ValuesPerMember is not equal to VariableSized), the method will return an array of values of the underlying data type.
  • If the enumeration's values have a variable size (i.e. ValuesPerMember is equal to VariableSized), the method will return an array of arrays of values of the underlying data type.
| Edit this page View Source

ToString()

Returns a string that represents the current object.

Declaration
public override string ToString()
Returns
Type Description
string

A string that represents the current object.

Overrides
object.ToString()

Implements

IDisposable
  • Edit this page
  • View Source
In this article
Back to top Copyright © 2018-2023 TileDB Inc.