001 /**
002 * This library is free software; you can redistribute it and/or modify it
003 * under the terms of the GNU Lesser General Public License (LGPL) as
004 * published by the Free Software Foundation; either version 3.0 of the
005 * License, or (at your option) any later version.
006 *
007 * This library is distributed in the hope that it will be useful, but
008 * WITHOUT ANY WARRANTY; without even the implied warranty of
009 * MERCHANTABILITY of FITNESS FOR A PARTICULAR PURPOSE. See the GNU
010 * Lesser General Public License for more details.
011 */
012
013 /**
014 * Title: JBarcodeBean
015 * Description: Barcode JavaBeans Component
016 * Copyright: Copyright (C) 2004
017 * Company: Dafydd Walters
018 */
019 package net.sourceforge.jbarcodebean;
020
021 /**
022 * Class representing a single barcode module (bar or space).
023 */
024 public class BarcodeElement implements java.io.Serializable {
025 public static final int TYPE_BAR = 1;
026 public static final int TYPE_SPACE = 0;
027 /**
028 * The width of the element expressed as a multiple of the narrowest module
029 * (bar/space) width.
030 */
031 private final int width;
032
033 private final int type;
034
035 public BarcodeElement(int type, int width) {
036 this.type = type;
037 this.width = width;
038 }
039
040 public int getWidth() {
041 return this.width;
042 }
043
044 public int getType() {
045 return this.type;
046 }
047 }