Terrenus HRPT v2.2

terrenus.telemetry
Class ShortSignatureChecker

java.lang.Object
  extended by terrenus.telemetry.ShortSignatureChecker
All Implemented Interfaces:
SignatureChecker
Direct Known Subclasses:
HRPTAuxSyncChecker, HRPTFrameSyncChecker

public class ShortSignatureChecker
extends java.lang.Object
implements SignatureChecker

The ShortSignatureChecker class checks signatures of short (16-bit) values.


Constructor Summary
ShortSignatureChecker(short[] signature, short mask)
          Creates a new checker.
 
Method Summary
 int getDifferenceCount(java.nio.ByteBuffer buf)
          Gets the number of bits different between the data and the known signature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShortSignatureChecker

public ShortSignatureChecker(short[] signature,
                             short mask)
Creates a new checker.

Parameters:
signature - the signature pattern data.
mask - the mask value. Only the bits turned on in the mask are used for comparing short values.
Method Detail

getDifferenceCount

public int getDifferenceCount(java.nio.ByteBuffer buf)
Description copied from interface: SignatureChecker
Gets the number of bits different between the data and the known signature.

Specified by:
getDifferenceCount in interface SignatureChecker
Parameters:
buf - the data buffer to check.
Returns:
the total number of bits different between data and reference. If zero, the data matches the signature.

Terrenus HRPT v2.2