importonly abstract class BaseScriptableDataSource extends AbstractDataSource
{
	public import function GetItem( index : Uint32 ) : IScriptable;
	public import function HasItem( data : IScriptable ) : Bool;
}

importonly class ScriptableDataSource extends BaseScriptableDataSource
{
	public import function AppendItem( data : IScriptable );
	public import function InsertItemAt( index : Uint32, data : IScriptable );
	public import function RemoveItem( data : IScriptable );
	public import function RemoveItemAt( index : Uint32 );
	public import function Clear();
	public import function GetArray() : array< IScriptable >;
	public import function GetArraySize() : Uint32;
	public import function Reset( scriptables : array< IScriptable > );
}

import class ScriptableDataView extends BaseScriptableDataSource
{
	public import function SetSource( source : weak< BaseScriptableDataSource > );
	public import function Filter();
	public import function EnableSorting();
	public import function DisableSorting();
	public import function IsSortingEnabled() : Bool;
	public import function Sort();

	public virtual function FilterItem( data : IScriptable ) : Bool
	{
		return true;
	}

	public virtual function SortItem( left : IScriptable, right : IScriptable ) : Bool
	{
		return true;
	}

}

importonly abstract class BaseWeakScriptableDataSource extends AbstractDataSource
{
	public import function GetItem( index : Uint32 ) : weak< IScriptable >;
	public import function HasItem( data : weak< IScriptable > ) : Bool;
}

importonly class WeakScriptableDataSource extends BaseWeakScriptableDataSource
{
	public import function AppendItem( data : weak< IScriptable > );
	public import function InsertItemAt( index : Uint32, data : weak< IScriptable > );
	public import function RemoveItem( data : weak< IScriptable > );
	public import function RemoveItemAt( index : Uint32 );
	public import function Clear();
	public import function GetArray() : array< weak< IScriptable > >;
	public import function Reset( scriptables : array< weak< IScriptable > > );
}

import class WeakScriptableDataView extends BaseWeakScriptableDataSource
{
	public import function SetSource( source : weak< BaseWeakScriptableDataSource > );
	public import function Filter();
	public import function EnableSorting();
	public import function DisableSorting();
	public import function IsSortingEnabled() : Bool;
	public import function Sort();

	public virtual function FilterItem( data : weak< IScriptable > ) : Bool
	{
		return true;
	}

	public virtual function SortItem( left : weak< IScriptable >, right : weak< IScriptable > ) : Bool
	{
		return true;
	}

}

