Videoautomat

videoautomat
Class VideoShop

java.lang.Object
  |
  +--sale.Shop
        |
        +--videoautomat.VideoShop
All Implemented Interfaces:
EventListener, Serializable, util.SerializableListener

public class VideoShop
extends sale.Shop

This is the central class for this application - the Shop. It contains the video-catalog and stock of this video-shop, the shop`s money and therefor a currency-catalog containing which coins this automat accepts and a Timer for simulation purposes.

See Also:
Serialized Form

Field Summary
static String C_CURRENCY
          Key of the currency -Catalog
static String C_VIDEOS
          Key of the video -Catalog
static String CC_VIDEOS
          Key of the video -CountingStock
static String FILENAME
          The name of the global log file
static String MB_MONEY
          Key of the MoneyBag
 
Fields inherited from class sale.Shop
DEAD, LOAD_TAG, m_jfShopFrame, m_lphProcesses, m_lspSalesPoints, m_mpToPersistify, m_rShopFrameBounds, m_sShopFrameTitle, m_trTimer, QUIT_SHOP_TAG, RUNNING, SAVE_TAG, SEPARATOR_ONE_TAG, SEPARATOR_TWO_TAG, SET_CURRENT_SP_TAG, SHOP_MENU_TAG, SUSPENDED
 
Constructor Summary
VideoShop()
          Constructs a new VideoShop and set it as Shop#setTheShop().
 
Method Summary
static void checkRentedVideos()
          Method to iterate over all rented videos and taking out those, which renting costs exceed the purchase price
protected  sale.MenuSheet createShopMenuSheet()
           
static data.ooimpl.EUROCurrencyImpl getCurrency()
          Helper method to avoid to long code-lines.
static data.ooimpl.MoneyBagImpl getMoneyBag()
          Helper method to avoid to long code-lines.
static data.ooimpl.CatalogImpl getVideoCatalog()
          Helper method to avoid to long code-lines.
static data.ooimpl.CountingStockImpl getVideoStock()
          Helper method to avoid to long code-lines.
 void quit()
          Overidden to avoid the annoying save-query, when quiting the application.
 
Methods inherited from class sale.Shop
addCatalog, addSalesPoint, addStock, canShutdown, clearInternalStructures, createShopFrame, getCatalog, getCurrentSalesPoint, getPersistentObject, getPersistentObjects, getProcessesLock, getSalesPoint, getSalesPoints, getSalesPointsLock, getShopFrame, getShopFrameBounds, getShopFrameTitle, getShopState, getStock, getTheShop, getTimer, isCurrentSalesPointAdjusting, log, makePersistent, onLoadFrames, onSalesPointAdded, onSalesPointRemoved, onSaveFrames, removeCatalog, removeSalesPoint, removeStatusDisplay, removeStock, resetCurrentSalesPointIsAdjusting, restore, resume, retrievePersistenceInStream, retrievePersistenceOutStream, runBackgroundProcess, runProcess, setCurrentSalesPoint, setCurrentSalesPointIsAdjusting, setObjectPersistent, setObjectTransient, setShopFrameBounds, setShopFrameTitle, setTheShop, setTimer, setViewMode, shutdown, start, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

C_VIDEOS

public static final String C_VIDEOS
Key of the video -Catalog


C_CURRENCY

public static final String C_CURRENCY
Key of the currency -Catalog


CC_VIDEOS

public static final String CC_VIDEOS
Key of the video -CountingStock


MB_MONEY

public static final String MB_MONEY
Key of the MoneyBag


FILENAME

public static final String FILENAME
The name of the global log file

See Also:
Constant Field Values
Constructor Detail

VideoShop

public VideoShop()
Constructs a new VideoShop and set it as Shop#setTheShop(). Also initialize the global Catalogs and Stocks and sets a Timer.

Method Detail

createShopMenuSheet

protected sale.MenuSheet createShopMenuSheet()
Overrides:
createShopMenuSheet in class sale.Shop
Returns:
the Shop`s MenuSheet, containing the default one, a button to start an automat and a button to switch the time further.
See Also:
Shop.createShopMenuSheet()

quit

public void quit()
Overidden to avoid the annoying save-query, when quiting the application.

Overrides:
quit in class sale.Shop
See Also:
Shop.quit()

getVideoCatalog

public static data.ooimpl.CatalogImpl getVideoCatalog()
Helper method to avoid to long code-lines.

Returns:
the global Catalog of videos.

getVideoStock

public static data.ooimpl.CountingStockImpl getVideoStock()
Helper method to avoid to long code-lines.

Returns:
the global Stock of videos

getMoneyBag

public static data.ooimpl.MoneyBagImpl getMoneyBag()
Helper method to avoid to long code-lines.

Returns:
the global MoneyBag containing the money of the shop.

getCurrency

public static data.ooimpl.EUROCurrencyImpl getCurrency()
Helper method to avoid to long code-lines.

Returns:
the global EUROCurrencyImpl -instance

checkRentedVideos

public static void checkRentedVideos()
Method to iterate over all rented videos and taking out those, which renting costs exceed the purchase price


Videoautomat