|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ka2ddo.yaac.ax25.StationState
public class StationState
This class maintains a record of the current state of a monitored station, and a reverse-chronologically-ordered history of all messages heard from the station. The accumulated state can be updated or recomputed from history at any time.
Nested Class Summary | |
---|---|
static class |
StationState.SpecialState
This enumeration identifies special conditions of a monitored station or object that color a background circle behind the icon for the station. |
Field Summary | |
---|---|
protected char |
altSymbolCode
The local alias symbol code within the specified symbol table for representing this station or object on the map. |
protected char |
altSymTableId
The local alias symbol table ID (or overlay character for alternate symbols). |
java.lang.String |
identifier
The String identifying this particular station or object. |
boolean |
isViewable
Whether or not this station or object should be displayed on the map. |
java.lang.String |
localAlias
The String identifying a local alias for this Station or Object. |
static long |
MINUTES_80
Constant defining 80 minutes (the period commonly considered to be out-of-date in APRS) in Java milliseconds. |
protected java.util.HashMap<java.lang.Object,java.lang.Object> |
miscAttachments
Place to attach miscellaneous attachments to a station or object. |
float |
rangeM
Scratch range variable used for aloha circle calculation. |
static java.util.Comparator<StationState> |
SORT_BY_IDENTIFIER
|
protected char |
symbolCode
The symbol code within the specified symbol table for representing this station or object on the map. |
protected char |
symTableId
The symbol table ID (or overlay character for alternate symbols). |
Constructor Summary | |
---|---|
StationState(java.lang.String callsign)
Create a new StationState object with the specified identifying String and the specified parent node for tree-style display of the information. |
Method Summary | |
---|---|
int |
addMessage(AX25Message msg)
Add a message to the accumulated history for this station. |
java.lang.StringBuilder |
appendAliasKV(java.lang.StringBuilder b)
Append the tactical alias for this station (or the undefinition if this station doesn't have an alias). |
void |
clearState()
Clear all accumulated inferred information about the station or object. |
int |
compareTo(StationState ss)
Compares this object with the specified object for order. |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. |
AX25Message |
get(int childIndex)
Get the Nth oldest message received from this station or object. |
long |
getAge(long now)
Report the time since this station's information was updated. |
int |
getAliasKVLength()
Return the length in characters of the tactical callsign exchange phrase for this station/object. |
char |
getAltSymbolCode()
Return the currently defined local alias symbolCode reported for this station or object. |
char |
getAltSymTableId()
Return the currently defined local alias identifier of the table containing the symbol reported for this station or object. |
float |
getAmsl()
Get the last known altitude of the specified station or object. |
java.lang.Object |
getAttachment(java.lang.Object key)
Get a named attachment for this station. |
java.lang.Object[] |
getAttachmentKeys()
Get all the keys for attachments on this station or object. |
float |
getBearing()
Get the last known course bearing for this station. |
java.lang.String |
getIdentifier()
Get the identifying name of the station or object described by this StationState. |
long |
getLastDigiTime()
Get the last time this station appeared as a digipeater. |
long |
getLastPosTime()
Get the timestamp when the position was last updated. |
double |
getLatitude()
Get the most recently reported or inferred latitude for this station or object. |
java.lang.String |
getLocalAlias()
Get the current locally defined alias for this Station or Object. |
double |
getLongitude()
Get the most recently reported or inferred longitude for this station or object. |
long |
getMostRecentPacketTime()
Get the last time a Message was received on behalf of this station or object or anything this station digipeated. |
PositionMessage |
getMostRecentPosition()
Get the last APRS position message reported for this station or object. |
long |
getMostRecentRcptTimeOfSelf()
Get the last time a Message was received on behalf of this station or object. |
AX25Message.Precedence |
getPrecedence()
Get the current Precedence state of this station or object. |
static long |
getPurgeThresholdSecs()
Get the time in seconds that messages will be kept before purging. |
float |
getRadiusOfConfidence()
Return the last reported position ambiguity, |
StationState.SpecialState |
getSpecialState(long now,
long age)
Derive the background color for a given object. |
float |
getSpeed()
Return the last known speed of travel of this station or object. |
char |
getSymbolCode()
Return the last symbolCode reported for this station or object. |
char |
getSymTableId()
Return the identifier of the table containing the symbol reported for this station or object. |
java.util.Map<java.lang.Enum,java.lang.Object> |
getWeatherStateMap()
Get the map containing extracted weather and hurricane information. |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
hasHurricane()
Report if this station is providing hurricane information. |
boolean |
hasPlaybackMessages()
Report if this station or object has any messages from played-back log files. |
boolean |
hasRealtimeMessages()
Report if this station has received any messages in real-time. |
boolean |
hasWeather()
Report if this station is providing weather information. |
boolean |
isActiveObject()
Indicates if this "station" is actually an Object or Item that is currently active (not killed). |
boolean |
isDirect(long oldestAllowed)
Report if the station has been directly heard by the local YAAC instance (without being digipeated) recently. |
static boolean |
isDoVicinityPlot()
Efficiently test if vicinity plotting should be done for stations not reporting position. |
boolean |
isIGateOnly()
Indicate if the station has only been heard via a IGate connection to the APRS-IS backbone. |
boolean |
isLocalRf(long oldestAllowed,
int maxDigis)
Indicate if the station is accessible over local RF. |
boolean |
isObject()
Reports if this station was last reported as a non-transmitting object or item, as defined by the APRS specifications. |
boolean |
isObjectOnly()
Reports if this station is actually a non-transmitting object or item, as defined by the APRS specifications. |
boolean |
isOnlyOverrapidGpsFixes()
If entire history of this station is GpsRawMessages at too fast a rate for APRS messaging, than it must be either a moron or a remote GPS (as defined in the SerialGpsConnector and SerialGpsPortEditor). |
StationState.SpecialState |
isStationMoving(long now)
Test if the station monitored by this StationState appears to be moving or remaining in a fixed location. |
boolean |
isTimeInRange(long timestamp)
Test if this station has any messages meeting the specified time range. |
java.util.Iterator<AX25Message> |
iterator()
Obtain an iterator to cycle through the messages accumulated for this station or object. |
int |
pruneOldMessages(long then)
Delete all messages from this StationState object whose receive times are older than the specified old age. |
java.lang.Object |
putAttachment(java.lang.Object key,
java.lang.Object attachment)
Add an attachment to this station or object. |
java.lang.Object |
removeAttachment(java.lang.Object key)
Remove an attachment from this station or object. |
void |
setAltSymbolCode(char altSymbolCode)
Set the currently defined local alias symbolCode reported for this station or object. |
void |
setAltSymTableId(char altSymTableId)
Set the currently defined local alias identifier of the table containing the symbol reported for this station or object. |
void |
setAmsl(float amsl)
Overwrite the altitude for this station/object. |
static void |
setDoVicinityPlot(boolean doVicinityPlot)
Remember if vicinity plotting should be done for stations not reporting position. |
void |
setLocalAlias(java.lang.String localAlias)
Set the current locally defined alias for this Station or Object. |
void |
setLocation(double latitude,
double longitude,
long timestampMsec)
Set the location for this station or object. |
static void |
setPurgeThresholdSecs(long purgeThresholdSecs)
Set the time in seconds before messages will be purged. |
void |
setSymbol(char symTableId,
char symbolCode)
Change the symbol code associated with this station. |
void |
setVelocity(float bearing,
float speedKts)
Set the speed and direction of motion for this station or object. |
int |
size()
Get the number of messages associated with this station or object. |
java.lang.String |
toString()
Return a string describing this object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long MINUTES_80
public java.lang.String identifier
public java.lang.String localAlias
protected char symTableId
protected char symbolCode
symTableId
protected char altSymTableId
protected char altSymbolCode
altSymTableId
public boolean isViewable
SendingStationFilter
public float rangeM
AlohaRanger
protected java.util.HashMap<java.lang.Object,java.lang.Object> miscAttachments
public static final java.util.Comparator<StationState> SORT_BY_IDENTIFIER
Constructor Detail |
---|
public StationState(java.lang.String callsign)
callsign
- String callsign or name of the station or objectMethod Detail |
---|
public static boolean isDoVicinityPlot()
public static void setDoVicinityPlot(boolean doVicinityPlot)
doVicinityPlot
- boolean true if stations should be vicinity plotted relative to the original digipeating stationpublic static long getPurgeThresholdSecs()
public static void setPurgeThresholdSecs(long purgeThresholdSecs)
purgeThresholdSecs
- time in seconds before messages are purged (non-positive
time specifies no purging)public void clearState()
public int addMessage(AX25Message msg)
msg
- AX25Message to add to the history of this station state
public int pruneOldMessages(long then)
then
- long time in milliseconds since Unix epoch that is the oldest time of messages not to be deleted
public boolean isOnlyOverrapidGpsFixes()
public boolean hasRealtimeMessages()
public boolean hasPlaybackMessages()
public boolean isTimeInRange(long timestamp)
timestamp
- border time in Java standard milliseconds since 1970 UTC
public final long getAge(long now)
now
- the current time in Java standard milliseconds since 1970 UTC
public float getAmsl()
public void setAmsl(float amsl)
amsl
- new altitude in meters above mean sea level relative to WGS84 geoidpublic java.lang.String getIdentifier()
public double getLatitude()
public double getLongitude()
public long getLastPosTime()
public long getLastDigiTime()
public float getBearing()
public float getSpeed()
DistanceUnit.NM
public boolean isDirect(long oldestAllowed)
oldestAllowed
- the time in milliseconds after which this station must have
been locally heard to report true
public boolean isLocalRf(long oldestAllowed, int maxDigis)
oldestAllowed
- oldest message time to check for local vs. non-localmaxDigis
- maximum number of digipeats to consider
public boolean isIGateOnly()
public float getRadiusOfConfidence()
public final char getSymbolCode()
public final char getSymTableId()
public final char getAltSymbolCode()
public final char getAltSymTableId()
public final void setAltSymbolCode(char altSymbolCode)
altSymbolCode
- symbol character, or '\0' if no alias usedpublic final void setAltSymTableId(char altSymTableId)
altSymTableId
- symbol table ID character or overlay character if overlay used, or '\0' if no alias usedpublic boolean hasWeather()
public boolean hasHurricane()
public boolean isObjectOnly()
ObjectReport
public boolean isObject()
ObjectReport
public java.util.Iterator<AX25Message> iterator()
public java.util.Map<java.lang.Enum,java.lang.Object> getWeatherStateMap()
public java.lang.String toString()
toString
in class java.lang.Object
public AX25Message get(int childIndex)
childIndex
- int index into accumulated message history
java.lang.IndexOutOfBoundsException
- if childIndex not in rangesize()
public int size()
public long getMostRecentRcptTimeOfSelf()
public long getMostRecentPacketTime()
public int compareTo(StationState ss)
compareTo
in interface java.lang.Comparable<StationState>
ss
- the StationState to be compared.
java.lang.NullPointerException
- if the specified object is null
java.lang.ClassCastException
- if the specified object's type prevents it
from being compared to this object.public StationState.SpecialState getSpecialState(long now, long age)
now
- time reference (in milliseconds since Jan 1 1970 UTC) to use to calculate ageage
- delta time since last received transmission from this station in milliseconds
public StationState.SpecialState isStationMoving(long now)
now
- current time in Java milliseconds since Jan 1 1970 UTC
public AX25Message.Precedence getPrecedence()
public PositionMessage getMostRecentPosition()
public boolean isActiveObject()
public java.lang.String getLocalAlias()
public void setLocalAlias(java.lang.String localAlias)
localAlias
- the String local alias for this Station or Object, or null to clear the aliaspublic void setSymbol(char symTableId, char symbolCode)
symTableId
- character for the symbol table and/or overlay for this station/objectsymbolCode
- character for the symbol within the specified table for this station/objectpublic void setLocation(double latitude, double longitude, long timestampMsec)
latitude
- latitude in degrees Northlongitude
- longitude in degrees EasttimestampMsec
- time in milliseconds since Jan 1 1970 UTC (epoch)public void setVelocity(float bearing, float speedKts)
bearing
- direction of travel in degrees from True NorthspeedKts
- sped of motion in knots (nautical miles per hour)public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the reference object with which to compare.
true
if this object is the same as the obj
argument; false
otherwise.hashCode()
,
Hashtable
public int hashCode()
java.util.Hashtable
.
hashCode
in class java.lang.Object
Object.equals(Object)
,
Hashtable
public java.lang.Object getAttachment(java.lang.Object key)
key
- Object identifying the particular attachment
public java.lang.Object putAttachment(java.lang.Object key, java.lang.Object attachment) throws java.lang.NullPointerException
key
- Object that will identify this particular attachmentattachment
- data to be attached
java.lang.NullPointerException
- if a null attachment is specifiedpublic java.lang.Object removeAttachment(java.lang.Object key)
key
- Object identifying the attachment to be removed
public java.lang.Object[] getAttachmentKeys()
public int getAliasKVLength()
public java.lang.StringBuilder appendAliasKV(java.lang.StringBuilder b)
b
- StringBuilder to append to
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |