org.openwms.common.domain.values
Class Barcode

java.lang.Object
  extended by org.openwms.common.domain.values.Barcode
All Implemented Interfaces:
Serializable

public class Barcode
extends Object
implements Serializable

A Barcode is a printable item with an unique identifier to label TransportUnits. The identifier has a defined number of characters whereas these characters are aligned either left or right. Non filled positions of a Barcode are padded with a so called padding character.

Since:
0.1
Version:
$Revision: 1594 $
Author:
Heiko Scherrer
See Also:
Serialized Form

Nested Class Summary
static class Barcode.BARCODE_ALIGN
          A BARCODE_ALIGN defines whether the Barcode is applied LEFT or RIGHT.
 
Constructor Summary
Barcode(String value)
          Create a new Barcode with a String.
 
Method Summary
 String adjustBarcode(String val)
          Force the Barcode to be aligned to the determined rules regarding padding, alignment.
static Barcode.BARCODE_ALIGN getAlignment()
          Returns the alignment.
static int getLength()
          Return the length.
static char getPadder()
          Return the padding character.
 String getValue()
          Return the Barcode value.
static boolean isPadded()
          Check if Barcode is padded.
static void setAlignment(Barcode.BARCODE_ALIGN align)
          Set the alignment.
 void setValue(String value)
          Set the Barcode value.
 String toString()
          Return the value of the Barcode as String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Barcode

public Barcode(String value)
Create a new Barcode with a String.

Parameters:
value - The value of the Barcode as String
Throws:
IllegalArgumentException - when the value is set to null.
Method Detail

adjustBarcode

public String adjustBarcode(String val)
Force the Barcode to be aligned to the determined rules regarding padding, alignment.

Parameters:
val - The old Barcode as String
Returns:
The new aligned Barcode

getAlignment

public static Barcode.BARCODE_ALIGN getAlignment()
Returns the alignment.

Returns:
The alignment

setAlignment

public static void setAlignment(Barcode.BARCODE_ALIGN align)
Set the alignment.

Parameters:
align - The alignment to set

isPadded

public static boolean isPadded()
Check if Barcode is padded.

Returns:
true if Barcode is padded, otherwise false.

getPadder

public static char getPadder()
Return the padding character.

Returns:
The padding character.

getValue

public String getValue()
Return the Barcode value.

Returns:
The value of the Barcode

setValue

public void setValue(String value)
Set the Barcode value.

Parameters:
value - The value to set

getLength

public static int getLength()
Return the length.

Returns:
The length

toString

public String toString()
Return the value of the Barcode as String.

Overrides:
toString in class Object
Returns:
As String
See Also:
Object.toString()


Copyright © 2005-2011 openwms.org. All Rights Reserved.