1 /**
2 * This library is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU Lesser General Public License (LGPL) as
4 * published by the Free Software Foundation; either version 3.0 of the
5 * License, or (at your option) any later version.
6 *
7 * This library is distributed in the hope that it will be useful, but
8 * WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY of FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
11 */
12
13 /**
14 * Title: JBarcodeBean
15 * Description: Barcode JavaBeans Component
16 * Copyright: Copyright (C) 2004
17 * Company: Dafydd Walters
18 */
19 package net.sourceforge.jbarcodebean;
20
21 /**
22 * Class representing a single barcode module (bar or space).
23 */
24 public class BarcodeElement implements java.io.Serializable {
25 public static final int TYPE_BAR = 1;
26 public static final int TYPE_SPACE = 0;
27 /**
28 * The width of the element expressed as a multiple of the narrowest module
29 * (bar/space) width.
30 */
31 private final int width;
32
33 private final int type;
34
35 public BarcodeElement(int type, int width) {
36 this.type = type;
37 this.width = width;
38 }
39
40 public int getWidth() {
41 return this.width;
42 }
43
44 public int getType() {
45 return this.type;
46 }
47 }