]> rtime.felk.cvut.cz Git - orte.git/blob - orte/java/src/org/ocera/orte/types/SequenceNumber.java
JORTE: fix the '2^32' problem and formatting in debug printf()
[orte.git] / orte / java / src / org / ocera / orte / types / SequenceNumber.java
1 /* SequenceNumber.java */
2
3 /**
4   * Class SequenceNumber substitutes the struct SequenceNumber
5   * from C-source code defines in: 'typedefs_defines_rtps.h'
6   *
7   *  typedef struct {
8   *      int32_t     high;
9   *      int32_t     low;
10   *  } SequenceNumber;
11   *
12   *
13   * @author Lukas Pokorny (lukas_pokorny@centrum.cz)
14   * @author CTU FEE Prague - Department of Control Engineering (dce.felk.cvut.cz)
15   * @author Project ORTE - OCERA Real Time Ethernet (www.ocera.org)
16   * @author dedication to Kj
17   * @version 0.1
18   *
19   *
20   * This program is free software; you can redistribute it and/or modify
21   * it under the terms of the GNU General Public License as published by
22   * the Free Software Foundation; either version 2 of the License, or
23   * (at your option) any later version.
24   *
25   * This program is distributed in the hope that it will be useful,
26   * but WITHOUT ANY WARRANTY; without even the implied warranty of
27   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28   * GNU General Public License for more details.
29   *
30   */
31
32 package org.ocera.orte.types;
33
34
35 public class SequenceNumber
36 {
37   private int    high;
38   private long    low;
39
40
41   /* constructor */
42   public SequenceNumber(int high, long low)
43   {
44     this.high = high;
45     this.low  = low;
46     //System.out.println(":j: instance SequenceNumber created..");
47   }
48
49   public SequenceNumber get()
50   {
51     return this;
52   }
53
54   public long getDecimal()
55   {
56     long sn = ((long)high << 32) + low;
57         return sn;      
58   }
59   
60 }
61