nl.esi.metis.aisparser.annotations.AISIllegalValueAnnotation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of EsiAisParser Show documentation
Show all versions of EsiAisParser Show documentation
This package supports the parsing of AIS messages in Java. AIS, the Automatic Identification System, is a system aiming at improving maritime safety by exchanging messages between ships, other vehicles in particular aircraft involved in search-and-rescue (SAR), and (fixed) base stations. To be precise, this package support the ITU-R M.1371-4 AIS standard.
See our extensive javadoc and in particular the class AISParser for more information on how to use this package.
The parser was used in the Poseidon project, and is improved in the Metis project to better handle uncertain information. Both projects were led by the Embedded Systems Institute. In both projects Thales Nederlands was the carrying industrial partner, and multiple Dutch universities participated.
The newest version!
/* ESI AIS Parser
*
* Copyright 2011/2012 by Pierre van de Laar & Pierre America (Embedded Systems Institute)
* Copyright 2008 by Brian C. Lane
* All Rights Reserved
*
*/
package nl.esi.metis.aisparser.annotations;
/** This class represents annotations related to deviations in value from the AIS standard that are detected during parsing of AIS messages.
* These annotations are stored in the provenance of the resulting message objects, so that they can analyzed by a client program.
* @author Pierre America
* @author Pierre van de Laar
*/
public class AISIllegalValueAnnotation implements AISAnnotation {
private String methodName;
private Object value;
private String range;
public AISIllegalValueAnnotation(String methodName, Object value, String range)
{
this.methodName = methodName;
this.value = value;
this.range = range;
}
/** Equality
* @param obj Object to compare to
*/
@Override
public boolean equals(Object obj) {
if (obj == this){
return true;
}
if (obj == null || obj.getClass() != this.getClass()){
return false;
}
AISIllegalValueAnnotation iva = (AISIllegalValueAnnotation) obj;
return (this.methodName.equals(iva.methodName)) && (this.value.equals(iva.value)) && (this.range.equals(iva.range));
}
public String toString()
{
return "Violation of standard: Value " + value.toString() + " of method " + methodName + " is outside the allowed range of " + range;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy