]> rtime.felk.cvut.cz Git - orte.git/blob - orte/java/src/org/ocera/orte/types/RecvStatus.java
New ORTE version 0.3.0 committed
[orte.git] / orte / java / src / org / ocera / orte / types / RecvStatus.java
1 /* RecvStatus.java */
2 package org.ocera.orte.types;
3
4
5 /**
6   * Class SendStatus
7   *
8   * @author Lukas Pokorny (lukas_pokorny@centrum.cz)
9   * @author CTU FEE Prague - Department of Control Engineering (dce.felk.cvut.cz)
10   * @author Project ORTE - OCERA Real Time Ethernet (www.ocera.org)
11   * @author dedication to Kj
12   * @version 0.1
13   *
14   * typedef enum ORTESendStatus {
15   *      NEED_DATA        = 0x01,
16   *      CQL              = 0x02
17   *    } ORTESendStatus;
18   *
19   * This program is free software; you can redistribute it and/or modify
20   * it under the terms of the GNU General Public License as published by
21   * the Free Software Foundation; either version 2 of the License, or
22   * (at your option) any later version.
23   *
24   * This program is distributed in the hope that it will be useful,
25   * but WITHOUT ANY WARRANTY; without even the implied warranty of
26   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27   * GNU General Public License for more details.
28   *
29   */
30
31 public class RecvStatus
32 {
33   // nemam to pridat k ostat konstantam????????
34   public static final int NEED_DATA = 0x01;
35   public static final int DEADLINE  = 0x02;
36
37   private int value;
38
39   /* constructor */
40   public RecvStatus(int a)
41   {
42     value = a;
43     System.out.println(":j: instance of RecvStatus created..");
44   }
45
46   /* toString */
47   public String toString()
48   {
49     return(value + " ");
50   }
51
52   /* get status */
53   public RecvStatus get()
54   {
55     return this;
56   }
57
58   /* set status */
59   public void set(int v)
60   {
61     value = v;
62     return;
63   }
64
65
66   public boolean needData()
67   {
68     if (this.value == NEED_DATA) return true;
69     return false;
70   }
71
72   public boolean deadline()
73   {
74     if (this.value == DEADLINE) return true;
75     return false;
76   }
77
78 }