Aztec® Programming Language
Version 1.1 Alpha 2

Copyright © 2010-2017, Aztec Development Group, All Rights Reserved

Download Aztec

Search        Contact Us

And this loneliness won't leave me alone.

- Jimmy Cliff

-- or --

- Otis Redding and Steve Cropper

 

aztec.util.Collection

public class Collection from<Base>

Base

Collection

The Collection class is an abstract class which provides a framework for various types of collections. A collection provides a general purpose storage mechanism for more than one object. Some collections are intended for small to medium size collections, such as List and Queue, and some are intended for efficient operations with large amounts of data (such as HashTable).

 

Collection Methods

Collection() Constructor for the Collection class
Size() Abstract method to return number of items in the collection
GotoTop() Abstract method to move internal "pointer" to top of list
GotoBottom() Abstract method to move internal "pointer" to bottom of list
GetCurrentItem() Abstract method to get "current" object in collection and move pointer position
IsCurrentValid() Abstract method to return true if the "pointer" currently points at a valid position
Clear() Abstract method to clear the entire list

Derived Classes

See Also

 


Collection()

public method Collection()

Parameters

None

Return Value

None

Description

Constructor for the abstract Collection class.

 

Collection Class


Size()

public abstract method<int> Size()

Parameters

None

Return Value

Returns size of collection

Description

Abstract method to return the total number of objects currently stored in the collection.

 

Collection Class


GotoTop()

public abstract method GotoTop()

Parameters

None

Return Value

None

Description

Abstract method to move the internal "pointer" to the top of the collection (which is defined internally by each type of collection). The "GetCurrent()" method returns the object which is at the current pointer location.

 

Collection Class


GotoBottom()

public abstract method GotoBottom()

Parameters

None

Return Value

None

Description

Abstract method to move the internal "pointer" to the bottom of the collection (which is defined internally by each type of collection). The "GetCurrent()" method returns the object which is at the current pointer location.

 

Collection Class


GetCurrentItem()

public abstract method<Base> GetCurrentItem(bool Forward = true)

Parameters

None

Return Value

Reference to current item

Description

Abstract method to return a reference to the object at the current "pointer" location within the collection.

 

If the Forward flag is true, the current pointer location is then advanced to the next object. If currently at the last position, the pointer is advanced to a "null" position.

 

If the forward flag is false, the current pointer is moved to the previous object in the collection. If currently at the first position, the pointer is advanced to the "null" position.

 

If the pointer ends up at the "null" position, the next "GetCurrentItem()" call will return null. The "GotoTop()" or "GotoBottom()" method must be used to reset the pointer to a valid position.

 

If the collection is empty, this method also returns null.

 

Collection Class


IsCurrentValid()

public abstract method<bool> IsCurrentValid()

Parameters

None

Return Value

True if current position is valid

Description

Abstract method to return true if the "current" pointer within the collection points at a valid position, and returns false if not. If the collection is empty, or if the end of the collection has been surpassed by making a "GetCurrentItem()" call at the end of the collection, the current "pointer" does not point at a valid position (and GetCurrentItem() returns null), so this method returns false.

 

Collection Class


Clear()

public abstract method Clear()

Parameters

None

Return Value

None

Description

Abstract method to clear all items from the collection.

 

Collection Class

 

Copyright © 2010-2017

Aztec Development Group

All Rights Reserved

Download Aztec