4 * Class CheckType checks the boundry of the types, which
5 * substitutes the 'unsigned' types from C sources, because
6 * the types used in Java source code are longer than the
7 * unsigned types in C source code. For example type 'long'
8 * [64bit] substitutes the type 'uint32_t' [32bit].
11 * @author Lukas Pokorny (lukas_pokorny@centrum.cz)
12 * @author CTU FEE Prague - Department of Control Engineering (dce.felk.cvut.cz)
13 * @author Project ORTE - OCERA Real Time Ethernet (www.ocera.org)
14 * @author dedication to Kj
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
30 package org.ocera.orte.tools;
33 public class CheckType {
35 /** constants - max and min boundry values of the unsigned integer32 */
36 final static long UINT32MAX = (2^32 - 1);
37 final static long UINT32MIN = 0;
41 * checkUINT_32 - check the boundry of the unsigned int32 type and
42 * return the bool value if the condition comes true or false
44 * @param number the value which will be checked
45 * @return boolean value - true if the number is within the range of the unsigned int32 type
50 boolean uint_32(long number)
52 if (number >= UINT32MIN && number <= UINT32MAX) return(true);