Videoautomat

videoautomat
Class VideoShop

java.lang.Object
  extended by Shop
      extended by videoautomat.VideoShop

public class VideoShop
extends 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.


Field Summary
static String C_CURRENCY
          Key of the currency -Catalog
static  C_VIDEOS
          Key of the video -Catalog
static String CAPTION_AUTOMAT
          The Caption of the VideoAutomat
static  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
static String MS_NEW
          Label for the menusheet that contains self-defined items
static String MSG_ACCESS
          Label for the admin- ActionCapability, if it`s not granted.
static String MSI_AUTOMAT
          Label for the button to start the automat
static String MSI_DAY
          Label for the time setter button
 
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  MenuSheet createShopMenuSheet()
           
static EUROCurrencyImpl getCurrency()
          Helper method to avoid to long code-lines.
static MoneyBagImpl getMoneyBag()
          Helper method to avoid to long code-lines.
static VideoCatalog getVideoCatalog()
          Helper method to avoid to long code-lines.
static AutomatVideoStock 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

C_VIDEOS

public static final  C_VIDEOS
Key of the video -Catalog


C_CURRENCY

public static final String C_CURRENCY
Key of the currency -Catalog

See Also:
Constant Field Values

CC_VIDEOS

public static final  CC_VIDEOS
Key of the video -CountingStock


MB_MONEY

public static final String MB_MONEY
Key of the MoneyBag

See Also:
Constant Field Values

FILENAME

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

See Also:
Constant Field Values

CAPTION_AUTOMAT

public static final String CAPTION_AUTOMAT
The Caption of the VideoAutomat

See Also:
Constant Field Values

MS_NEW

public static final String MS_NEW
Label for the menusheet that contains self-defined items

See Also:
Constant Field Values

MSI_AUTOMAT

public static final String MSI_AUTOMAT
Label for the button to start the automat

See Also:
Constant Field Values

MSG_ACCESS

public static final String MSG_ACCESS
Label for the admin- ActionCapability, if it`s not granted.

See Also:
Constant Field Values

MSI_DAY

public static final String MSI_DAY
Label for the time setter button

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 MenuSheet createShopMenuSheet()
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:
sale.Shop#createShopMenuSheet()

quit

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

See Also:
sale.Shop#quit()

getVideoCatalog

public static VideoCatalog getVideoCatalog()
Helper method to avoid to long code-lines.

Returns:
the global Catalog of videos.

getVideoStock

public static AutomatVideoStock getVideoStock()
Helper method to avoid to long code-lines.

Returns:
the global Stock of videos

getMoneyBag

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

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

getCurrency

public static 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