Namespace: OpenEdge.Core.Collections
Class
Array
Parent classes:
Progress.Lang.Object

Inherits: Progress.Lang.Object
Implements: OpenEdge.Core.Collections.IList

Copyright (c) 2013-2014, 2017, 2020-2021 by Progress Software Corporation. All rights reserved.
File:Array
Purpose:Hold and manage a collection of objects within a variable with extent.
Author(s):pjudge
Created:Thu Jun 14 11:35:49 EDT 2012
Notes:* Based on the AutoEdge|TheFactory version
Updated 11/13/2019 by S.E. Southwell - Make size
reflect number of items rather than underlying array size.
/* only ever used for ToTable()




Method Summary
Options Name Purpose
LOGICAL Add (integer, Object) /* Adds the element to the array, at the index provicded @param integer A positive integer value @param Progress.Lang.Object[] An array of objects to add. May be indeterminate. @return logical Returns TRUE if the object was added, FALSE if not. */
LOGICAL Add (Object) /* Add an object to the array at the end. Logical alias for SetValue. Always returns true if there's not an error @param P.L.Object The object to add to the array. @return logical returns TRUE */
LOGICAL AddAll (ICollection) /* Add items from the supplied collection to this Array @param ICollection A collection of objects to add. @return logical Returns TRUE if any the array was added, FALSE if not. */
LOGICAL AddAll (integer, ICollection) /* Adds the collection to the array, at the index provicded @param integer A non-negative integer value @param ICollection A collection of objects to add. @return logical Returns TRUE if the object was added, FALSE if not. */
LOGICAL AddArray (integer, Object[]) /* Adds all of the elements in the input array to this one, starting at the index @param integer A non-negative integer value @param Progress.Lang.Object[] An array of objects to add. May be indeterminate. @return logical Returns TRUE if any the array was added, FALSE if not. */
LOGICAL AddArray (Object[]) /* Adds all of the elements in the input array to this one, starting at the end of the array. @param Progress.Lang.Object[] An array of objects to add. May be indeterminate. @return logical Returns TRUE if any the array was added, FALSE if not. */
Clear () /* Remove all elements from the array and sets the size to 0. Keeps the array's length as-is */
Progress.Lang.Object Clone () /* Deep clone. or rather deep enough since we don't know what the elements' Clone() operations do, so this may end up being a memberwise clone @return P.L.Object the cloned object */
CloneElements (ICollection) /* Clones this objects's elements into a collection @param ICollection The collections into which to clone this array's elements */
LOGICAL Contains (Object) /* See whether the passed-in object is a member of the Array @param P.L.Object An object to check. Can be unknown @return logical TRUE if the passed-in object appears at least once in the array */
LOGICAL ContainsAll (ICollection) /* Returns true if this list contains all of the elements of the specified collection. @param ICollection The collection of objects to check @return logical True if all the elements match */
LOGICAL Equals (Object) /* Two Lists are defined to be equal if they are the same size and all of the elements in this collection are in the to-compare List and in the same sequence. @param P.L.Object @return logical TRUE if the Lists are equal. FALSE otherwise */
Progress.Lang.Object Get (integer) /* Returns the object represented by the index @param integer The sequence to find. Must be positive and <= the Size. @return Object The object represented by the sequence. May be ? */
Progress.Lang.Object GetValue (integer) /* Get the value of the object at the given position in the array. @param integer The index of the item to return. Must be non-negative @return P.L.Object The object at the index location. May be null */
INTEGER IndexOf (Object) /* Returns the first index or 0/zero for the given element @param P.L.O The element to find @return integer The first index at which the element can be found, or 0 */
InsertElement (integer, Object) /* Inserts an element, and moves the rest along @param integer A positive index @param P.L.Object The element to add */
InsertElements (integer, Object[]) /* Inserts elements from an array, and moves the rest along @param integer A positive index @param P.L.Object[] The elements to add */
LOGICAL IsEmpty () /* Report whether the object contains anything. Underlying variable extent size may be > 0 and the object still be empty. @return logical TRUE is the Size is 0, FALSE otherwise */
OpenEdge.Core.Collections.IIterator Iterator () /* Provide an iterator for the Array. This is an ArrayIterator which implements IIterator and ListIterator. @return IIterator An iterator for this array */
INTEGER LastIndexOf (Object) /* Returns the last index or 0/zero for the given element @param P.L.O The element to find @return integer The last index at which the element can be found, or 0 */
OpenEdge.Core.Collections.IListIterator ListIterator () /* Returns an iterator for this list @return IListIterator An iterator */
OpenEdge.Core.Collections.IListIterator ListIterator (integer) /* Returns an iterator for this list. The index must be 'off by 1', so that the Next() and Previous() semantics in the IListIterator work. This means that the range of values is 0 ... array Size - 1 @param integer A non-negative index to start iterating at. From 0 to Size - 1. @return IListIterator An iterator */
Progress.Lang.Object Remove (integer) /* Removes an entry and reduces the array's size @param integer The positive index @return P.L.O The object that was removed */
LOGICAL Remove (Object) /* Remove an object from the array. This method removes only the first match it finds. To remove all of the instances of the object, either call Remove(obj) until it returns false, or create a collection with a single element, and call RemoveAll(coll). @param P.L.Object The object to remove @return logical TRUE if the object was removed */
LOGICAL RemoveAll (ICollection) /* Removes all of those elements that appear in the input collection. @param ICollection The collection containing the elements to remove @return logical TRUE if any elements were removed */
LOGICAL RetainAll (ICollection) /* Keeps only those elements that appear in the input collection; all others are removed from the array @param ICollection The collection containing the elements to retain @return logical TRUE if any elements were removed */
Progress.Lang.Object Set (integer, Object) /* Overwrites an element at an index with another @param integer The positive index location to overwrite @param P.L.Object The object to save. May be null @return P.L.Object The object being replaced in the array */
SetValue (Object) /* Set the value at the end of the array. @param P.L.Object An object to add to the array */
SetValue (Object, integer) /* Set the value for a particular index to an object @param P.L.Object An object to add to the array @param integer The index at which to add */
OpenEdge.Core.Collections.IList SubList (integer, integer) /* Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. The fromIndex value must be positive and <= this list's Size The toIndex value must be positive and <= this list's Size The fromIndex value must be <= toIndex value If fromIndex and toIndex are equal, the returned list has 1 entry. @param integer fromIndex Low endpoint (INCLUSIVE) of the subList @param integer toIndex High endpoint (INCLUSIVE) of the subList @return IList a List containing the items. Has at least 1 entry. */
Progress.Lang.Object ToArray () /* Returns an array of size this-object:Size, with all references to the original array (a shallow copy). @return Progress.Lang.Object[] A new array. May be indeterminate */
ToTable (table-handle) /* Returns the array as a temp-table @param table-handle A cope of ttArray containing the array */
INTEGER UpdateLength (integer) /* Changes the Length of the array. This method does *not* change the Size, but returns the new size. Respects the AutoExpand and DiscardOnShrink properties. @param integer The new length. If null or negative, then the DefaultArraySize is used. If zero, the array is reset @return integer The size of the array (ie how many elements). This may have changed, particularly if the array was shrunk */

Constructor Summary
Options Name Purpose
Array () /* Static constructor */
Array () /* Default constructor */
Array (integer) /* Constructor @param integer The length of the array */
Array (Object[]) /* Constructor @param Progress.Lang.Object[] An array to shallow-clone (ie copy elements into self) */

Property Summary
Options Name Purpose
LOGICAL AutoExpand
INTEGER DefaultArraySize
LOGICAL DiscardOnShrink
INTEGER Length
INTEGER Size
Progress.Lang.Object Value


Method Detail
Top

LOGICAL Add (integer, Object)

/* Adds the element to the array, at the index provicded
Parameters:
pIndex INTEGER
pElement Progress.Lang.Object
Returns LOGICAL
logical Returns TRUE if the object was added, FALSE if not.
Top

LOGICAL Add (Object)

/* Add an object to the array at the end. Logical alias for SetValue.
Always returns true if there's not an error
Parameters:
o Progress.Lang.Object
Returns LOGICAL
logical returns TRUE
Top

LOGICAL AddAll (ICollection)

/* Add items from the supplied collection to this Array
Parameters:
c OpenEdge.Core.Collections.ICollection
Returns LOGICAL
logical Returns TRUE if any the array was added, FALSE if not.
Top

LOGICAL AddAll (integer, ICollection)

/* Adds the collection to the array, at the index provicded
Parameters:
pIndex INTEGER
pCollection OpenEdge.Core.Collections.ICollection
Returns LOGICAL
logical Returns TRUE if the object was added, FALSE if not.
Top

LOGICAL AddArray (integer, Object[])

/* Adds all of the elements in the input array to this one, starting at the index
Parameters:
pIndex INTEGER
pArray Progress.Lang.Object
Returns LOGICAL
logical Returns TRUE if any the array was added, FALSE if not.
Top

LOGICAL AddArray (Object[])

/* Adds all of the elements in the input array to this one, starting at the end
of the array.
Parameters:
c Progress.Lang.Object
Returns LOGICAL
logical Returns TRUE if any the array was added, FALSE if not.
Top

Clear ()

/* Remove all elements from the array and sets the size to 0. Keeps the array's length as-is
Top

Progress.Lang.Object Clone ()

/* Deep clone. or rather deep enough since we don't know what the elements' Clone()
operations do, so this may end up being a memberwise clone
Returns Progress.Lang.Object
P.L.Object the cloned object
Top

CloneElements (ICollection)

/* Clones this objects's elements into a collection
Parameters:
poClone OpenEdge.Core.Collections.ICollection
Top

LOGICAL Contains (Object)

/* See whether the passed-in object is a member of the Array
Parameters:
o Progress.Lang.Object
Returns LOGICAL
logical TRUE if the passed-in object appears at least once in the array
Top

LOGICAL ContainsAll (ICollection)

/* Returns true if this list contains all of the elements of the
specified collection.
Parameters:
poCollection OpenEdge.Core.Collections.ICollection
Returns LOGICAL
logical True if all the elements match
Top

LOGICAL Equals (Object)

/* Two Lists are defined to be equal if they are the same size and
all of the elements in this collection are in the to-compare List and
in the same sequence.
Parameters:
o Progress.Lang.Object
Returns LOGICAL
logical TRUE if the Lists are equal. FALSE otherwise
Top

Progress.Lang.Object Get (integer)

/* Returns the object represented by the index
Parameters:
pIndex INTEGER
Returns Progress.Lang.Object
Object The object represented by the sequence. May be ?
Top

Progress.Lang.Object GetValue (integer)

/* Get the value of the object at the given position in the array.
Parameters:
piExtent INTEGER
Returns Progress.Lang.Object
P.L.Object The object at the index location. May be null
Top

INTEGER IndexOf (Object)

/* Returns the first index or 0/zero for the given element
Parameters:
pElement Progress.Lang.Object
Returns INTEGER
integer The first index at which the element can be found, or 0
Top

InsertElement (integer, Object)

/* Inserts an element, and moves the rest along
Parameters:
pIndex INTEGER
pElement Progress.Lang.Object
Top

InsertElements (integer, Object[])

/* Inserts elements from an array, and moves the rest along
Parameters:
pIndex INTEGER
pElement Progress.Lang.Object
Top

LOGICAL IsEmpty ()

/* Report whether the object contains anything. Underlying variable extent size
may be > 0 and the object still be empty.
Returns LOGICAL
logical TRUE is the Size is 0, FALSE otherwise
Top

OpenEdge.Core.Collections.IIterator Iterator ()

/* Provide an iterator for the Array. This is an ArrayIterator which implements IIterator and ListIterator.
Returns OpenEdge.Core.Collections.IIterator
IIterator An iterator for this array
Top

INTEGER LastIndexOf (Object)

/* Returns the last index or 0/zero for the given element
Parameters:
pElement Progress.Lang.Object
Returns INTEGER
integer The last index at which the element can be found, or 0
Top

OpenEdge.Core.Collections.IListIterator ListIterator ()

/* Returns an iterator for this list
Returns OpenEdge.Core.Collections.IListIterator
IListIterator An iterator
Top

OpenEdge.Core.Collections.IListIterator ListIterator (integer)

/* Returns an iterator for this list. The index must be 'off by 1',
so that the Next() and Previous() semantics in the IListIterator work.
This means that the range of values is 0 ... array Size - 1
Parameters:
pIndex INTEGER
Returns OpenEdge.Core.Collections.IListIterator
IListIterator An iterator
Top

Progress.Lang.Object Remove (integer)

/* Removes an entry and reduces the array's size
Parameters:
pIndex INTEGER
Returns Progress.Lang.Object
P.L.O The object that was removed
Top

LOGICAL Remove (Object)

/* Remove an object from the array. This method removes only the first match it finds. To remove
all of the instances of the object, either call Remove(obj) until it returns false, or create
a collection with a single element, and call RemoveAll(coll).
Parameters:
o Progress.Lang.Object
Returns LOGICAL
logical TRUE if the object was removed
Top

LOGICAL RemoveAll (ICollection)

/* Removes all of those elements that appear in the input collection.
Parameters:
c OpenEdge.Core.Collections.ICollection
Returns LOGICAL
logical TRUE if any elements were removed
Top

LOGICAL RetainAll (ICollection)

/* Keeps only those elements that appear in the input collection; all others
are removed from the array
Parameters:
pCollection OpenEdge.Core.Collections.ICollection
Returns LOGICAL
logical TRUE if any elements were removed
Top

Progress.Lang.Object Set (integer, Object)

/* Overwrites an element at an index with another
Parameters:
pIndex INTEGER
pElement Progress.Lang.Object
Returns Progress.Lang.Object
P.L.Object The object being replaced in the array
Top

SetValue (Object)

/* Set the value at the end of the array.
Parameters:
poValue Progress.Lang.Object
Top

SetValue (Object, integer)

/* Set the value for a particular index to an object
Parameters:
poValue Progress.Lang.Object
piExtent INTEGER
Top

OpenEdge.Core.Collections.IList SubList (integer, integer)

/* Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
The fromIndex value must be positive and <= this list's Size
The toIndex value must be positive and <= this list's Size
The fromIndex value must be <= toIndex value
If fromIndex and toIndex are equal, the returned list has 1 entry.
Parameters:
pFromIndex INTEGER
pToIndex INTEGER
Returns OpenEdge.Core.Collections.IList
IList a List containing the items. Has at least 1 entry.
Top

Progress.Lang.Object ToArray ()

/* Returns an array of size this-object:Size, with all references to the original array
(a shallow copy).
Returns Progress.Lang.Object
Progress.Lang.Object[] A new array. May be indeterminate
Top

ToTable (table-handle)

/* Returns the array as a temp-table
Parameters:
tt TABLE-HANDLE
Top

INTEGER UpdateLength (integer)

/* Changes the Length of the array. This method does *not* change the Size, but returns the
new size. Respects the AutoExpand and DiscardOnShrink properties.
particularly if the array was shrunk
Parameters:
pNewLength INTEGER
Returns INTEGER
integer The size of the array (ie how many elements). This may have changed,


Constructor Detail
Top

STATIC Array ()

/* Static constructor
Top

Array ()

/* Default constructor
Top

Array (integer)

/* Constructor
Parameters:
pLength INTEGER
Top

Array (Object[])

/* Constructor
Parameters:
poArray Progress.Lang.Object


Property Detail
Top

LOGICAL AutoExpand

Returns LOGICAL
Top

INTEGER DefaultArraySize

Returns INTEGER
Top

LOGICAL DiscardOnShrink

Returns LOGICAL
Top

INTEGER Length

Returns INTEGER
Top

INTEGER Size

Returns INTEGER
Top

Progress.Lang.Object Value

Returns Progress.Lang.Object


Copyright © 2022 Progress Software Corporation. All rights Reserved.

Progress® OpenEdge® Release 11.7.15