C# Класс Pchp.Core.PhpArray

Implements ordered keyed array of PhpValue with PHP semantics.
Наследование: PhpHashtable, IPhpConvertible, IPhpArray, IPhpComparable, IPhpEnumerable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
_intrinsicEnumerator OrderedDictionary.Enumerator

Открытые методы

Метод Описание
AddValue ( PhpValue value ) : void
Compare ( PhpValue obj ) : int
DeepCopy ( ) : PhpArray

Creates copy of this instance using shared underlaying hashtable.

EnsureItemAlias ( IntStringKey key ) : PhpAlias
EnsureItemArray ( IntStringKey key ) : IPhpArray
EnsureItemObject ( IntStringKey key ) : object
GetEnumerator ( ) : OrderedDictionary.Enumerator

Gets PHP enumerator for this array.

GetForeachEnumerator ( bool aliasedValues ) : IPhpEnumerator

Creates an enumerator used in foreach statement.

GetForeachEnumerator ( bool aliasedValues, RuntimeTypeHandle caller ) : IPhpEnumerator

Creates an enumerator used in foreach statement.

Used for internal purposes only!

GetItemValue ( IntStringKey key ) : PhpValue
Keyed ( ) : PhpArray

Creates an instance of PhpArray filled by given entries.

If the length of keysValues is odd then its last item is added without a key.

New ( ) : PhpArray

Creates an instance of PhpArray filled by given values.

New ( PhpValue value ) : PhpArray

Creates an instance of PhpArray filled by given values.

PhpArray ( ) : System

Creates a new instance of PhpArray with specified capacities for integer and string keys respectively.

PhpArray ( Array values ) : System

Creates a new instance of PhpArray initialized with all values from System.Array.

PhpArray ( Array values, int index, int length ) : System

Creates a new instance of PhpArray initialized with a portion of System.Array.

PhpArray ( IEnumerable data ) : System

Creates a new instance of PhpArray filled by data from an enumerator.

PhpArray ( PhpArray array, bool preserveMaxInt ) : System

Copy constructor. Creates PhpArray that shares internal data table with another PhpArray.

PhpArray ( int capacity ) : System

Creates a new instance of PhpArray with specified capacities for integer and string keys respectively.

PhpArray ( int intCapacity, int stringCapacity ) : System

Creates a new instance of PhpArray with specified capacities for integer and string keys respectively.

RemoveKey ( IntStringKey key ) : void
RestartIntrinsicEnumerator ( ) : void

Restarts intrinsic enumerator - moves it to the first item.

If the intrinsic enumerator has never been used on this instance nothing happens.

SetItemAlias ( IntStringKey key, PhpAlias alias ) : void
SetItemValue ( IntStringKey key, PhpValue value ) : void
ToBoolean ( ) : bool
ToClass ( ) : object
ToDouble ( ) : double
ToLong ( ) : long
ToNumber ( PhpNumber &number ) : Convert.NumberInfo
ToString ( Context ctx ) : string
ToStringOrThrow ( Context ctx ) : string

Описание методов

AddValue() публичный Метод

public AddValue ( PhpValue value ) : void
value PhpValue
Результат void

Compare() публичный Метод

public Compare ( PhpValue obj ) : int
obj PhpValue
Результат int

DeepCopy() публичный Метод

Creates copy of this instance using shared underlaying hashtable.
public DeepCopy ( ) : PhpArray
Результат PhpArray

EnsureItemAlias() публичный Метод

public EnsureItemAlias ( IntStringKey key ) : PhpAlias
key IntStringKey
Результат PhpAlias

EnsureItemArray() публичный Метод

public EnsureItemArray ( IntStringKey key ) : IPhpArray
key IntStringKey
Результат IPhpArray

EnsureItemObject() публичный Метод

public EnsureItemObject ( IntStringKey key ) : object
key IntStringKey
Результат object

GetEnumerator() публичный Метод

Gets PHP enumerator for this array.
public GetEnumerator ( ) : OrderedDictionary.Enumerator
Результат OrderedDictionary.Enumerator

GetForeachEnumerator() публичный Метод

Creates an enumerator used in foreach statement.
public GetForeachEnumerator ( bool aliasedValues ) : IPhpEnumerator
aliasedValues bool Whether the values returned by enumerator are assigned by reference.
Результат IPhpEnumerator

GetForeachEnumerator() публичный Метод

Creates an enumerator used in foreach statement.
Used for internal purposes only!
public GetForeachEnumerator ( bool aliasedValues, RuntimeTypeHandle caller ) : IPhpEnumerator
aliasedValues bool Whether the values returned by enumerator are assigned by reference.
caller System.RuntimeTypeHandle Type of the caller (ignored).
Результат IPhpEnumerator

GetItemValue() публичный Метод

public GetItemValue ( IntStringKey key ) : PhpValue
key IntStringKey
Результат PhpValue

Keyed() публичный статический Метод

Creates an instance of PhpArray filled by given entries.
If the length of keysValues is odd then its last item is added without a key.
public static Keyed ( ) : PhpArray
Результат PhpArray

New() публичный статический Метод

Creates an instance of PhpArray filled by given values.
public static New ( ) : PhpArray
Результат PhpArray

New() публичный статический Метод

Creates an instance of PhpArray filled by given values.
public static New ( PhpValue value ) : PhpArray
value PhpValue Value to be added to the new instance. /// Keys will correspond order of values in the array.
Результат PhpArray

PhpArray() публичный Метод

Creates a new instance of PhpArray with specified capacities for integer and string keys respectively.
public PhpArray ( ) : System
Результат System

PhpArray() публичный Метод

Creates a new instance of PhpArray initialized with all values from System.Array.
public PhpArray ( Array values ) : System
values System.Array
Результат System

PhpArray() публичный Метод

Creates a new instance of PhpArray initialized with a portion of System.Array.
public PhpArray ( Array values, int index, int length ) : System
values System.Array
index int
length int
Результат System

PhpArray() публичный Метод

Creates a new instance of PhpArray filled by data from an enumerator.
public PhpArray ( IEnumerable data ) : System
data IEnumerable The enumerator containing values added to the new instance.
Результат System

PhpArray() публичный Метод

Copy constructor. Creates PhpArray that shares internal data table with another PhpArray.
public PhpArray ( PhpArray array, bool preserveMaxInt ) : System
array PhpArray Table to be shared.
preserveMaxInt bool True to copy the from . /// Otherwise the value will be recomputed when needed. See http://phalanger.codeplex.com/workitem/31484 for more details.
Результат System

PhpArray() публичный Метод

Creates a new instance of PhpArray with specified capacities for integer and string keys respectively.
public PhpArray ( int capacity ) : System
capacity int
Результат System

PhpArray() публичный Метод

Creates a new instance of PhpArray with specified capacities for integer and string keys respectively.
public PhpArray ( int intCapacity, int stringCapacity ) : System
intCapacity int
stringCapacity int
Результат System

RemoveKey() публичный Метод

public RemoveKey ( IntStringKey key ) : void
key IntStringKey
Результат void

RestartIntrinsicEnumerator() публичный Метод

Restarts intrinsic enumerator - moves it to the first item.
If the intrinsic enumerator has never been used on this instance nothing happens.
public RestartIntrinsicEnumerator ( ) : void
Результат void

SetItemAlias() публичный Метод

public SetItemAlias ( IntStringKey key, PhpAlias alias ) : void
key IntStringKey
alias PhpAlias
Результат void

SetItemValue() публичный Метод

public SetItemValue ( IntStringKey key, PhpValue value ) : void
key IntStringKey
value PhpValue
Результат void

ToBoolean() публичный Метод

public ToBoolean ( ) : bool
Результат bool

ToClass() публичный Метод

public ToClass ( ) : object
Результат object

ToDouble() публичный Метод

public ToDouble ( ) : double
Результат double

ToLong() публичный Метод

public ToLong ( ) : long
Результат long

ToNumber() публичный Метод

public ToNumber ( PhpNumber &number ) : Convert.NumberInfo
number PhpNumber
Результат Convert.NumberInfo

ToString() публичный Метод

public ToString ( Context ctx ) : string
ctx Context
Результат string

ToStringOrThrow() публичный Метод

public ToStringOrThrow ( Context ctx ) : string
ctx Context
Результат string

Описание свойств

_intrinsicEnumerator защищенное свойство

Intrinsic enumerator associated with the array. Initialized lazily.
protected OrderedDictionary.Enumerator _intrinsicEnumerator
Результат OrderedDictionary.Enumerator