com.sage.accpac.sm
Class ActiveApplications

java.lang.Object
  extended by com.sage.accpac.sm.ActiveApplications
All Implemented Interfaces:
java.lang.Iterable<ActiveApplication>

@Immutable
@ThreadSafe
public class ActiveApplications
extends java.lang.Object
implements java.lang.Iterable<ActiveApplication>

Collection of active applications on a Sage Accpac ERP database pair (both company and system databases).
An object of this class cannot be created directly by an application; it should be obtained from the Program object's getActiveApplications() method.
The collection contains only those entries that were present when getActiveApplications() was called; applications activated since then are not included in the collection. Similarly the actual entries in the collection reflect the state of the application when getActiveApplications() was called.
Since the collection is iterable and the contents are immutable the easiest way to use the collection is in a foreach loop:

 for (ActiveApplication a: s.getActiveApplications()) {
     Process the application a
 }
 

See Also:
ActiveApplication
Thread safety
Immutable and therefore thread-safe.

Method Summary
 ActiveApplication get(int index)
          Get the specified ActiveApplication object by its index in the collection.
 ActiveApplication get(java.lang.String prefix)
          Get the specified ActiveApplication object
 int getCount()
          Get the number of applications in the list.
 java.util.Iterator<ActiveApplication> iterator()
          Get an iterator on the collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCount

public int getCount()
Get the number of applications in the list. Note that the collection is iterable so you may not need to know how many there are; simply loop on the contents.
 for (ActiveApplication a: s.getActiveApplications()) {
     Process the application a
 }
 

See Also:
get(int), iterator()

get

public ActiveApplication get(int index)
Get the specified ActiveApplication object by its index in the collection. You may want to consider iterating over the collection using an iterator rather than this method.

Parameters:
index - The zero-based index of the object in the collection.
See Also:
getCount(), iterator()

get

public ActiveApplication get(java.lang.String prefix)
Get the specified ActiveApplication object

Parameters:
prefix - The application prefix of the application
Returns:
null if the application is not in the list and the application if it is

iterator

public java.util.Iterator<ActiveApplication> iterator()
Get an iterator on the collection. Frequently this is used "behind the scenes" merely by using a foreach loop:
 for (ActiveApplication a: s.getActiveApplications()) {
     Process the application a;
 }
 

Specified by:
iterator in interface java.lang.Iterable<ActiveApplication>
Thread safety
remember that the returned iterator is not thread-safe


Copyright © 2010 Sage Software, Inc. All rights reserved.