import { int } from '../../../customTypings' ; author Guenther Grau
  export default class Codeword { private static BARCODE_ROW_UNKNOWN : int = - 1 ; private startX : int ; private endX : int ; private bucket : int ; private value : int ; private rowNumber : int = Codeword . BARCODE_ROW_UNKNOWN ; constructor ( startX , endX , bucket , value ) { this . startX = Math . trunc ( startX ) ; this . endX = Math . trunc ( endX ) ; this . bucket = Math . trunc ( bucket ) ; this . value = Math . trunc ( value ) ; } hasValidRowNumber ( ) { return this . isValidRowNumber ( this . rowNumber ) ; } isValidRowNumber ( rowNumber ) { return rowNumber !== Codeword . BARCODE_ROW_UNKNOWN && this . bucket === ( rowNumber % 3 ) * 3 ; } setRowNumberAsRowIndicatorColumn ( ) { this . rowNumber = Math . trunc ( ( Math . trunc ( this . value / 30 ) ) * 3 + Math . trunc ( this . bucket / 3 ) ) ; } getWidth ( ) { return this . endX - this . startX ; } getStartX ( ) { return this . startX ; } getEndX ( ) { return this . endX ; } getBucket ( ) { return this . bucket ; } getValue ( ) { return this . value ; } getRowNumber ( ) { return this . rowNumber ; } setRowNumber ( rowNumber ) { this . rowNumber = rowNumber ; } public toString ( ) { return this . rowNumber + '|' + this . value ; } }