All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.esi.metis.aisparser.impl.AISMessage15MessageImpl Maven / Gradle / Ivy

Go to download

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!
package nl.esi.metis.aisparser.impl;

import nl.esi.metis.aisparser.AISMessage15Message;
import nl.esi.metis.aisparser.Sixbit;
/** ESI AIS Parser
 * 
 * Copyright 2011/2012 by Pierre van de Laar (Embedded Systems Institute)
 * Copyright 2008 by Brian C. Lane 
 * All Rights Reserved
 * 
 * @author Pierre van de Laar
 * @author Brian C. Lane
 */

/**
 * Field Nr     Field Name                          NrOf Bits   (from, to )
 * ------------------------------------------------------------------------
 *  1	messageID                            	  6	(  0,  5)
 *  2	slot offset                       	     12	(  6,  17)
 *                                               ---- +
 *                     (maximum) number of bits    18
 */
class AISMessage15MessageImpl implements AISMessage15Message {
	private static final int MESSAGEID_FROM = 0;
	private static final int MESSAGEID_TO = 5;

	private int messageID;
	/** messageID
	 * @return int value of messageID (6 bits offset+[0,5])
	 */
	public int getMessageID() { return messageID; }


	private static final int SLOTOFFSET_FROM = 6;
	private static final int SLOTOFFSET_TO = 17;

	private int slotOffset;
	/** slotOffset
	 * @return int value of slotOffset (12 bitsoffset+[6,17])
	 */
	public int getSlotOffset() { return slotOffset; }

	public AISMessage15MessageImpl (int offset, Sixbit content)
	{
		assert(content.length() >= offset + SLOTOFFSET_TO);
		messageID = content.getIntFromTo(offset+MESSAGEID_FROM,offset+MESSAGEID_TO);
		slotOffset = content.getIntFromTo(offset+SLOTOFFSET_FROM,offset+SLOTOFFSET_TO);

	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy