public class CotEvent
extends java.lang.Object
implements android.os.Parcelable
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<CotEvent> |
CREATOR |
static java.lang.String |
HOW_HUMAN_GARBAGE_IN_GARBAGE_OUT
Value of a human generated how attribute
|
static java.lang.String |
HOW_MACHINE_GENERATED
A good default and value of a machine generated how attribute
|
static java.lang.String |
TAG |
static java.lang.String |
VERSION_2_0
Default version attribute value (2.0)
|
Constructor and Description |
---|
CotEvent()
Create a default state event.
|
CotEvent(CotEvent event)
Copy constructor.
|
CotEvent(android.os.Parcel source)
Create the event from its Parcel representation.
|
CotEvent(java.lang.String _uid,
java.lang.String _type,
java.lang.String _vers,
CotPoint _point,
CoordinatedTime _time,
CoordinatedTime _start,
CoordinatedTime _stale,
java.lang.String _how,
CotDetail _detail,
java.lang.String _opex,
java.lang.String _qos,
java.lang.String _access)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
buildXml(java.lang.Appendable b) |
void |
buildXml(java.lang.StringBuffer b)
Given a string buffer, produce a well formed CoT message.
|
void |
buildXml(java.lang.StringBuilder b)
Given a string buffer, produce a well formed CoT message.
|
int |
describeContents() |
static java.lang.String |
escapeXmlText(java.lang.String innerText) |
CotDetail |
findDetail(int startIndex,
java.lang.String name)
Find a detail element
Convenience method for
CotDetail.getFirstChildByName(int, String) |
CotDetail |
findDetail(java.lang.String name) |
java.lang.String |
getAccess() |
CotPoint |
getCotPoint()
Get this event point as a CotPoint
|
CotDetail |
getDetail()
Get this event root detail
|
GeoPoint |
getGeoPoint()
From the CotPoint, derive the correct GeoPoint.
|
java.lang.String |
getHow()
Get this event how
|
static java.lang.String |
getLogDateString()
Retrieves a date as a formatted string useful for using as part of a file name.
|
java.lang.String |
getOpex() |
java.lang.String |
getQos() |
CoordinatedTime |
getStale()
Get this event stale time
|
CoordinatedTime |
getStart()
Get this event start time
|
CoordinatedTime |
getTime()
Get this event time
|
java.lang.String |
getType()
Get this event 'type' attribute
|
java.lang.String |
getUID()
Get this event UID
|
java.lang.String |
getVersion()
Get this 'version' attribute
|
boolean |
isValid()
Determine if the event is valid
|
static CotEvent |
parse(java.lang.String xml)
Parse a event from an XML string
|
void |
setAccess(java.lang.String access)
Set the 'access' attribute of the event
|
void |
setDetail(CotDetail detail)
Set the detail tag.
|
void |
setHow(java.lang.String how)
Set the 'how' attribute of the event (e.g.
|
static void |
setLogInvalid(boolean log,
java.io.File directory)
Location to log invalid CoT messages.
|
void |
setOpex(java.lang.String opex)
Set the 'opex' attribute of the event
|
void |
setPoint(CotPoint point)
Set the point tag details
|
void |
setQos(java.lang.String qos)
Set the 'qos' (quality of service) attribute of the event
|
void |
setStale(CoordinatedTime stale)
Set the time this event leaves from scope
|
void |
setStart(CoordinatedTime start)
Set the time this event starts scope
|
void |
setTime(CoordinatedTime time)
Set the time this event was generated
|
void |
setType(java.lang.String type)
Set the CoT type (e.g.
|
void |
setUID(java.lang.String uid)
Set the unique identifier for the object the event describes
|
void |
setVersion(java.lang.String vers)
Set the version attribute.
|
java.lang.String |
toString() |
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final java.lang.String TAG
public static final java.lang.String VERSION_2_0
public static final java.lang.String HOW_MACHINE_GENERATED
public static final java.lang.String HOW_HUMAN_GARBAGE_IN_GARBAGE_OUT
public static final android.os.Parcelable.Creator<CotEvent> CREATOR
public CotEvent()
public CotEvent(java.lang.String _uid, java.lang.String _type, java.lang.String _vers, CotPoint _point, CoordinatedTime _time, CoordinatedTime _start, CoordinatedTime _stale, java.lang.String _how, CotDetail _detail, java.lang.String _opex, java.lang.String _qos, java.lang.String _access)
public CotEvent(CotEvent event)
public CotEvent(android.os.Parcel source)
source
- the source Parcelpublic boolean isValid()
public static java.lang.String getLogDateString()
public static void setLogInvalid(boolean log, java.io.File directory)
public void writeToParcel(android.os.Parcel dest, int flags)
writeToParcel
in interface android.os.Parcelable
public java.lang.String getVersion()
public java.lang.String getType()
public java.lang.String getUID()
public CotPoint getCotPoint()
public GeoPoint getGeoPoint()
public CotDetail getDetail()
public CotDetail findDetail(int startIndex, java.lang.String name)
CotDetail.getFirstChildByName(int, String)
startIndex
- Child index to begin searchingname
- Detail namepublic CotDetail findDetail(java.lang.String name)
public CoordinatedTime getTime()
public CoordinatedTime getStart()
public CoordinatedTime getStale()
public java.lang.String getHow()
public java.lang.String getOpex()
public java.lang.String getQos()
public java.lang.String getAccess()
public void buildXml(java.lang.StringBuffer b)
b
- the string buffer.public void buildXml(java.lang.StringBuilder b)
b
- the string builder.public void buildXml(java.lang.Appendable b) throws java.io.IOException
java.io.IOException
public static CotEvent parse(java.lang.String xml)
xml
- public java.lang.String toString()
toString
in class java.lang.Object
public int describeContents()
describeContents
in interface android.os.Parcelable
public static java.lang.String escapeXmlText(java.lang.String innerText)
public void setVersion(java.lang.String vers)
vers
- the version if it is other than 2.0public void setType(java.lang.String type)
type
- the type of the CoT eventpublic void setUID(java.lang.String uid)
uid
- the unique identifier. Should be opaque and not used for interpretation.public void setPoint(CotPoint point)
point
- the pointjava.lang.IllegalArgumentException
- if point is nullpublic void setDetail(CotDetail detail)
detail
- the detail tagjava.lang.IllegalArgumentException
- if the CotDetail element name isn't "detail"public void setTime(CoordinatedTime time)
time
- the time based on coordinated time.public void setStart(CoordinatedTime start)
start
- the start time of the event.public void setStale(CoordinatedTime stale)
stale
- the stale time of the eventpublic void setHow(java.lang.String how)
how
- the how for the event.public void setOpex(java.lang.String opex)
opex
- public void setQos(java.lang.String qos)
qos
- public void setAccess(java.lang.String access)
access
-