PageMixer demonstration

common
Class ShoppingItem

java.lang.Object
  |
  +--common.ShoppingItem

public class ShoppingItem
extends java.lang.Object

Container for shopping item information.


Field Summary
static ShoppingItem[] ENTRIES
          Array of sample items.
 
Constructor Summary
ShoppingItem(java.lang.String id, java.lang.String name, int price)
           
 
Method Summary
 java.lang.String getID()
          Get ID.
 java.lang.String getName()
          Get name.
 java.lang.String getName(java.util.Locale locale)
          Get localized(L18N) name.
 int getPrice()
          Get price.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENTRIES

public static final ShoppingItem[] ENTRIES
Array of sample items.
Constructor Detail

ShoppingItem

public ShoppingItem(java.lang.String id,
                    java.lang.String name,
                    int price)
Method Detail

getID

public java.lang.String getID()
Get ID.

getName

public java.lang.String getName()
Get name.

getName

public java.lang.String getName(java.util.Locale locale)
Get localized(L18N) name.

This looks ResourceBundle up by name "common.ShoppingItemName", looks value up in ResourceBundle by ID specified at construction time, then return it if found. Otherwise, this returns name specified at constructio time (= value returned by getName()).


getPrice

public int getPrice()
Get price.

PageMixer demonstration