JACK 5.4 JACOB Application Interface

aos.apib
Class BaseList

java.lang.Object
  extended byaos.util.ObservableStatus
      extended byaos.apib.BaseList
All Implemented Interfaces:
Aggregate, Base

public class BaseList
extends aos.util.ObservableStatus
implements Aggregate, Base

BaseList is an implementation of the Aggregate interface. Its intended use is as a container to hold an indeterminate number of Objects implementing the Base interface, similar to a Java Vector.

See Also:
Serialized Form

Constructor Summary
BaseList()
           
 
Method Summary
 Base addAfter(Base existing_obj, Base new_obj)
          Adds a Jacob Base Object to the Aggregate one position after an Object already present in the Aggregate. Any Base Objects in the Aggregate located after the Object in the second parameter will be shifted to make way for the new Object.

If the object in the second parameter cannot be found, this method will return null. Otherwise, the added Object is returned.

 Base addAt(Base obj, int index)
          Adds a Jacob Base Object to the Aggregate at the given index position. Any Base Objects in the Aggregate located at or after the given index will be shifted to make way for the new Object.

If the given index is less than zero, this method will return null. However, if the index given is greater than the index of the last element in the Aggregate, the new Object will simply be added to the end of the Aggregate. Under normal circumstances, this method returns the Object added to the Aggregate.

 Base addBefore(Base existing_obj, Base new_obj)
          Adds a Jacob Base Object to the Aggregate one position before an Object already present in the Aggregate. Any Base Objects in the Aggregate located before the Object in the second parameter will be shifted to make way for the new Object.

If the object in the second parameter cannot be found, this method will return null. Otherwise, the added Object is returned.

 Base addFirst(Base obj)
          Adds a Jacob Base Object to the start of the Aggregate.
 Base addLast(Base obj)
          Adds a Jacob Base Object to the end of the Aggregate.
 Base elementAt(int index)
          Returns the Jacob Base element at the given index of the Aggregate. If the index is less than zero, or greater than the index of the last element in the Aggregate, this method returns null.
 java.util.Enumeration elements()
          Returns the Aggregate as an Enumeration of elements of type AggregateEnumeration.
 void empty()
          Permanently removes all elements currently stored in the Aggregate.
 int getSize()
          Returns the number of elements currently stored in the Aggregate.
 StreamerSupport getStreamer()
          Returns the StreamerSupport for the object implementing this interface.
protected  void notifyChanged(int type, int index, java.lang.Object o)
           
 Base replace(Base old_obj, Base new_obj)
          Replaces a Jacob Base Object currently stored in the Aggregate with a new one.

If the Object to replace does not exist in the Aggregate, this method will return null. Otherwise, the Object that was added is returned.

 Base rm(Base obj)
          Removes a given Jacob Base Object from the Aggregate. Any Base Objects in the Aggregate located after the given Object will be shifted to fill the space left by its removal.

If the given Object does not exist in the Aggregate, this method will return null. Otherwise, the removed Object is returned.

 Base rmAt(int index)
          Removes a Jacob Base Object from the Aggregate at a given index position. Any Base Objects in the Aggregate located after the given index will be shifted to fill the space left by the removed Object.

If the given index is less than zero, or greater than the index of the last element in the Aggregate, this method will return null. Otherwise, the removed Object is returned.

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseList

public BaseList()
Method Detail

getStreamer

public StreamerSupport getStreamer()
Description copied from interface: Base
Returns the StreamerSupport for the object implementing this interface.

Specified by:
getStreamer in interface Base

empty

public void empty()
Permanently removes all elements currently stored in the Aggregate.

Specified by:
empty in interface Aggregate

addLast

public Base addLast(Base obj)
Adds a Jacob Base Object to the end of the Aggregate.

Specified by:
addLast in interface Aggregate
Returns:
the Jacob Base Object that was added to the end of the Aggregate.

addFirst

public Base addFirst(Base obj)
Adds a Jacob Base Object to the start of the Aggregate.

Specified by:
addFirst in interface Aggregate
Returns:
the Jacob Base Object that was added to the start of the Aggregate.

replace

public Base replace(Base old_obj,
                    Base new_obj)
Replaces a Jacob Base Object currently stored in the Aggregate with a new one.

If the Object to replace does not exist in the Aggregate, this method will return null. Otherwise, the Object that was added is returned.

Specified by:
replace in interface Aggregate
Returns:
the Jacob Base Object that was added to the Aggregate; otherwise null.

rm

public Base rm(Base obj)
Removes a given Jacob Base Object from the Aggregate. Any Base Objects in the Aggregate located after the given Object will be shifted to fill the space left by its removal.

If the given Object does not exist in the Aggregate, this method will return null. Otherwise, the removed Object is returned.

Specified by:
rm in interface Aggregate
Returns:
the Jacob Base Object that was removed from the Aggregate; otherwise null.

addAfter

public Base addAfter(Base existing_obj,
                     Base new_obj)
Adds a Jacob Base Object to the Aggregate one position after an Object already present in the Aggregate. Any Base Objects in the Aggregate located after the Object in the second parameter will be shifted to make way for the new Object.

If the object in the second parameter cannot be found, this method will return null. Otherwise, the added Object is returned.

Specified by:
addAfter in interface Aggregate
Returns:
the Jacob Base Object that was added to the Aggregate; otherwise null.

elementAt

public Base elementAt(int index)
Returns the Jacob Base element at the given index of the Aggregate. If the index is less than zero, or greater than the index of the last element in the Aggregate, this method returns null.

Specified by:
elementAt in interface Aggregate
Parameters:
index - the index of the Jacob Base Object to be retrieved.
Returns:
the Jacob Base Object at the given index of the Aggregate; otherwise null.

addAt

public Base addAt(Base obj,
                  int index)
Adds a Jacob Base Object to the Aggregate at the given index position. Any Base Objects in the Aggregate located at or after the given index will be shifted to make way for the new Object.

If the given index is less than zero, this method will return null. However, if the index given is greater than the index of the last element in the Aggregate, the new Object will simply be added to the end of the Aggregate. Under normal circumstances, this method returns the Object added to the Aggregate.

Specified by:
addAt in interface Aggregate
Parameters:
index - the index at which the Jacob Base Object should be added.
Returns:
the Jacob Base Object that was added to the Aggregate; otherwise null.

rmAt

public Base rmAt(int index)
Removes a Jacob Base Object from the Aggregate at a given index position. Any Base Objects in the Aggregate located after the given index will be shifted to fill the space left by the removed Object.

If the given index is less than zero, or greater than the index of the last element in the Aggregate, this method will return null. Otherwise, the removed Object is returned.

Specified by:
rmAt in interface Aggregate
Parameters:
index - the index of the Jacob Base Object to be removed from the Aggregate.
Returns:
the Jacob Base Object that was removed from the Aggregate; otherwise null.

addBefore

public Base addBefore(Base existing_obj,
                      Base new_obj)
Adds a Jacob Base Object to the Aggregate one position before an Object already present in the Aggregate. Any Base Objects in the Aggregate located before the Object in the second parameter will be shifted to make way for the new Object.

If the object in the second parameter cannot be found, this method will return null. Otherwise, the added Object is returned.

Specified by:
addBefore in interface Aggregate
Returns:
the Jacob Base Object that was added to the Aggregate; otherwise null.

elements

public java.util.Enumeration elements()
Returns the Aggregate as an Enumeration of elements of type AggregateEnumeration.

Specified by:
elements in interface Aggregate
Returns:
the Aggregate as an Enumeration of elements of type AggregateEnumeration.

getSize

public int getSize()
Returns the number of elements currently stored in the Aggregate.

Specified by:
getSize in interface Aggregate
Returns:
the number of elements currently stored in the Aggregate.

notifyChanged

protected void notifyChanged(int type,
                             int index,
                             java.lang.Object o)

JACK 5.4 JACOB Application Interface

Copyright (C) 1999-2008, Agent Oriented Software Pty. Ltd.

US Government Restricted Rights
The JACK Modules and relevant Software Material have been developed entirely at private expense and are accordingly provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of DFARS 252.227-7013 or subparagraph (c)(1) and (2) of the Commercial Computer Software Restricted Rights and 48 CFR 52.2270-19, as applicable.


Agent Oriented Software Pty. Ltd.     http://www.aosgrp.com
PO Box 639, Carlton South, Victoria 3053, Australia
Phone: +61 3 9349 5055, Fax: +61 3 9349 5088