Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ka2ddo.yaac.core
Class LocalObjectTracker

    java.lang.Object
      org.ka2ddo.yaac.core.LocalObjectTracker

All Implemented Interfaces:
  AprsMessageListener

    public class LocalObjectTracker

extends java.lang.Object
implements AprsMessageListener

This class manages and tracks the state of Objects being originated by the local station. It handles shutting down an Object when some other station takes it over, and adding Objects to this list when locally created or taken over from other stations.

Nested Class Summary
`static interface` | `LocalObjectTracker.LocalObjectListener` This interfaces defines an object that can be informed about changes to the ObjectReports stored in the LocalObjectTracker,
`static class` | `LocalObjectTracker.ObjectLink` This class maintains an association between a local ObjectReport and the ObjectReportSender used to transmit this object to the network (assuming that the Object is enabled for transmission).

Method Summary
`void` | `add(ObjectReport or)` Add another ObjectReport to the tracker, that does not currently have an ObjectReportSender.
`void` | `add(ObjectReportSender ors)` Add another ObjectReport to the tracker, that in currently encapsulated by an ObjectReportSender.
`void` | `addLocalObjectListener(LocalObjectTracker.LocalObjectListener l)` Register a listener to be informed of changes in the tracker.
`void` | `aprsMessageReceived(Message msg)` Delivers the next message received by YAAC that is an APRS message.
`LocalObjectTracker.ObjectLink` | `get(int index)` Get the Nth ObjectReport record in the tracker.
`LocalObjectTracker.ObjectLink` | `get(java.lang.String objectName)` Get the ObjectReport record in the tracker with a specified object name,
`static LocalObjectTracker` | `getInstance()` Get the singleton instance of the LocalObjectTracker.
`int` | `indexOf(java.lang.String objectName)` Get the zero-based index of the tracked ObjectReport with the specified name
`void` | `remove(java.lang.String objectName)` Stop tracking an ObjectReport with the specified name.
`void` | `removeLocalObjectListener(LocalObjectTracker.LocalObjectListener l)` Unregister a listener to be informed of changes in the tracker.
`int` | `size()` Report the number of ObjectReports currently being tracked.

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

Method Detail

### getInstance

    public static LocalObjectTracker getInstance()

  Get the singleton instance of the LocalObjectTracker.

  Returns:
    LocalObjectTracker instance

### aprsMessageReceived

    public void aprsMessageReceived(Message msg)

  Delivers the next message received by YAAC that is an APRS message.

  Specified by:
    `aprsMessageReceived` in interface `AprsMessageListener`
  Parameters:
    `msg` - some subclass of Message containing the message contents; the message should have an AX25Frame connected to it
  See Also:
    `AX25Frame`, `AX25Message.ax25Frame`, `AX25Message.getAx25Frame()`

### size

    public int size()

  Report the number of ObjectReports currently being tracked.

  Returns:
    count of ObjectReports

### get

    public LocalObjectTracker.ObjectLink get(int index)
                                      throws java.lang.IndexOutOfBoundsException

  Get the Nth ObjectReport record in the tracker.

  Parameters:
    `index` - zero-based index of record to fetch
  Returns:
    ObjectLink wrapper around selected ObjectReport
  Throws:
    `java.lang.IndexOutOfBoundsException` - if index is negative or greater than the number of entries in the tracker

### get

    public LocalObjectTracker.ObjectLink get(java.lang.String objectName)

  Get the ObjectReport record in the tracker with a specified object name,

  Parameters:
    `objectName` - String of object name
  Returns:
    ObjectLink wrapper around selected ObjectReport, or null if no ObjectReport with specified name

### add

    public void add(ObjectReport or)

  Add another ObjectReport to the tracker, that does not currently have an ObjectReportSender.

  Parameters:
    `or` - ObjectReport to add

### add

    public void add(ObjectReportSender ors)

  Add another ObjectReport to the tracker, that in currently encapsulated by an ObjectReportSender.

  Parameters:
    `ors` - ObjectReportSender to add

### remove

    public void remove(java.lang.String objectName)

  Stop tracking an ObjectReport with the specified name.

  Parameters:
    `objectName` - String name of object to unregister

### indexOf

    public int indexOf(java.lang.String objectName)

  Get the zero-based index of the tracked ObjectReport with the specified name

  Parameters:
    `objectName` - String name of ObjectReport
  Returns:
    zero-based index of the object, or -1 if not in the tracker

### addLocalObjectListener

    public void addLocalObjectListener(LocalObjectTracker.LocalObjectListener l)

  Register a listener to be informed of changes in the tracker.

  Parameters:
    `l` - LocalObjectListener to register

### removeLocalObjectListener

    public void removeLocalObjectListener(LocalObjectTracker.LocalObjectListener l)

  Unregister a listener to be informed of changes in the tracker.

  Parameters:
    `l` - LocalObjectListener to unregister

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD