OpenECHO
 All Classes Namespaces Files Functions Variables
EchoProperty.java
Go to the documentation of this file.
1 package com.sonycsl.echo;
2 
3 public class EchoProperty {
4 
5  public final byte epc;
6  public final byte pdc;
7  public final byte[] edt;
8 
9  public EchoProperty(byte epc, byte pdc, byte[] edt) {
10  this.epc = epc;
11  this.pdc = pdc;
12  this.edt = edt;
13  }
14 
15  public EchoProperty(byte epc, byte[] edt) {
16  this(epc, (edt == null) ? (byte)0 : (byte)edt.length, edt);
17  }
18 
19  public EchoProperty(byte epc) {
20  this(epc, (byte)0, new byte[0]);
21  }
22 
23 
24  public int size() {
25  if(edt != null) return edt.length + 2;
26  return 2;
27  }
28 
29  public EchoProperty copy() {
30  EchoProperty ret;
31  if(edt == null) {
32  ret = new EchoProperty(epc, null);
33  } else {
34  byte[] edt_ = new byte[edt.length];
35  for(int i = 0; i < edt.length; i++) {
36  edt_[i] = edt[i];
37  }
38  ret = new EchoProperty(epc, edt_);
39  }
40  return ret;
41  }
42 }
EchoProperty(byte epc, byte pdc, byte[] edt)
EchoProperty(byte epc, byte[] edt)