MG Library

Library of Michael Galloy

single page | use frames     summary     class     fields     routine details     file attributes

collection/

mgabstractlist__define.pro

Abstract class to define a list interface. This class is not intended to be instantiated, just to be inherited from.

Class description for mgabstractlist

Subclasses: mgarraylist

Properties

version get

Fields

version 0L

a counter that is incremented as the list is modified (so iterators know if the underlying list has changed)

Routines

mgabstractlist::getProperty [, version=long]
mgabstractlist::add, elements [, position=integer]

Add elements to the list.

result = mgabstractlist::count()

Returns the number of elements in the list.

result = mgabstractlist::get( [/all] [, position=integer] [, count=integer] [, isa=string or strarr])

Get elements of the list.

result = mgabstractlist::isContained(elements [, position=long])

Determines whether a list contains specified elements.

mgabstractlist::move, source, destination

Move an element of the list to another position.

mgabstractlist::remove [, elements] [, position=long] [, /all]

Remove specified elements from the list.

result = mgabstractlist::iterator()

Creates an iterator to iterate through the elements of the list.

mgabstractlist::cleanup

Free resouces.

result = mgabstractlist::init()

Initialize list.

mgabstractlist__define

Define member variables.

Routine details

topmgabstractlist::getProperty

mgabstractlist::getProperty [, version=long]

Keywords

version out optional type=long

a counter that is incremented as the list is modified (so iterators know if the underlying list has changed)

topmgabstractlist::addabstract

mgabstractlist::add, elements [, position=integer]

Add elements to the list.

Parameters

elements in required type=list type

scalar or vector array of the same type as the list

Keywords

position in optional type=integer default=end of list

index to insert elements at (NOT IMPLEMENTED)

topmgabstractlist::countabstract

result = mgabstractlist::count()

Returns the number of elements in the list.

Return value

long integer

topmgabstractlist::getabstract

result = mgabstractlist::get( [/all] [, position=integer] [, count=integer] [, isa=string or strarr])

Get elements of the list.

Return value

element(s) of the list or -1L if no elements to return

Keywords

all in optional type=boolean

set to return all elements

position in optional type=integer

set to an index or an index array of elements to return; defaults to 0 if ALL keyword not set

count out optional type=integer

set to a named variable to get the number of elements returned by this function

isa in optional type=string or strarr

classname(s) of objects to return; only allowable if list type is object

topmgabstractlist::isContainedabstract

result = mgabstractlist::isContained(elements [, position=long])

Determines whether a list contains specified elements.

Return value

1B if contained or 0B if otherwise

Parameters

elements in required type=type of list

scalar or vector of elements of the same type as the list

Keywords

position out optional type=long

set to a named variable that will return the position of the first instance of the corresponding element of the specified elements

topmgabstractlist::moveabstract

mgabstractlist::move, source, destination

Move an element of the list to another position.

Parameters

source in required type=long

index of the element to move

destination in required type=long

index of position to move element

topmgabstractlist::removeabstract

mgabstractlist::remove [, elements] [, position=long] [, /all]

Remove specified elements from the list.

Parameters

elements in optional type=type of list

elements of the list to remove

Keywords

position in optional type=long

set to a scalar or vector array of indices to remove from the list

all in optional type=boolean

set to remove all elements of the list

topmgabstractlist::iteratorabstract

result = mgabstractlist::iterator()

Creates an iterator to iterate through the elements of the list. The destruction of the iterator is the responsibility of the caller of this method.

Return value

MGAbstractIterator object

topmgabstractlist::cleanup

mgabstractlist::cleanup

Free resouces.

topmgabstractlist::init

result = mgabstractlist::init()

Initialize list.

Return value

1B

topmgabstractlist__define

mgabstractlist__define

Define member variables.

File attributes

Modification date: Tue Nov 20 11:24:28 2007
Lines: 154