cafe.gui
Class UserInfo

java.lang.Object
  extended by cafe.gui.UserInfo

public class UserInfo
extends java.lang.Object

User information is relayed in instances of this class.

Version:
0.21
Author:
Markus Penttil�

Constructor Summary
UserInfo(java.lang.String username, java.lang.String givenname, java.lang.String familyname, UserBalance[] balance, int[] fingerprints, ExportProduct favoriteProduct, ExportProduct[] userproductlist, java.lang.String language, boolean cancelAllowed)
          Constructs a new UserInfo with the given parameters.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Overrides the equals method.
 UserBalance[] getBalances()
          Returns user's balances in different product groups.
 java.lang.String getDefaultLanguage()
          Returns user's default language.
 java.lang.String getFamilyname()
          Returns user's family name.
 ExportProduct getFavoriteProduct()
          Returns user's favorite (regular) product.
 int getFingerprint(int finger)
          Returns the fingerprint id for a chosen finger.
 java.lang.String getGivenname()
          Returns user's given (first) name.
 java.lang.String getUsername()
          Returns user's username
 ExportProduct[] getUserproductlist()
          Returns list of all exportable products, sorted as favoured by this user.
 boolean isCancelAllowed()
          Tells if the user is allowed to cancel a previous product export transacrion.
 void setBalances(UserBalance[] balance)
          Sets user's balance in all product groups.
 void setCancelAllowed(boolean value)
          Sets the variable that tells if the user is allowed to cancel a product export transaction.
 void setDefaultLanguage(java.lang.String defaultlang)
          Sets user's default language.
 void setFamilyname(java.lang.String familyname)
          Sets user's family name.
 void setFavoriteProduct(ExportProduct favoriteProduct)
          Sets user's favorite product to some ExportProduct.
 void setFingerprint(int finger, int id)
          Set's a finger's fingerprint to a given id.
 void setGivenname(java.lang.String givenname)
          Sets user's given (first) name.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserInfo

public UserInfo(java.lang.String username,
                java.lang.String givenname,
                java.lang.String familyname,
                UserBalance[] balance,
                int[] fingerprints,
                ExportProduct favoriteProduct,
                ExportProduct[] userproductlist,
                java.lang.String language,
                boolean cancelAllowed)
Constructs a new UserInfo with the given parameters.

Parameters:
username - user's username
givenname - user's given (first) name
familyname - user's family name
balance - user's balance in different product groups
fingerprints - the id numbers of user's stored fingerprints
favoriteProduct - user's regular portion (favorite product)
userproductlist - list of all exportable products, sorted per user favorism.
language - user's default language
cancelAllowed - if user can cancel a previous export transaction
Method Detail

getDefaultLanguage

public java.lang.String getDefaultLanguage()
Returns user's default language.

Returns:
user's default language

setDefaultLanguage

public void setDefaultLanguage(java.lang.String defaultlang)
Sets user's default language.

Parameters:
defaultlang - the default language for the user

getFamilyname

public java.lang.String getFamilyname()
Returns user's family name.

Returns:
user's family name

setFamilyname

public void setFamilyname(java.lang.String familyname)
Sets user's family name.

Parameters:
familyname - the family name to set

getFingerprint

public int getFingerprint(int finger)
Returns the fingerprint id for a chosen finger.

Returns:
the fingerprint's id number.

setFingerprint

public void setFingerprint(int finger,
                           int id)
Set's a finger's fingerprint to a given id.

Parameters:
finger - The chosen finger.
id - The new fingerprint id for the finger.

getGivenname

public java.lang.String getGivenname()
Returns user's given (first) name.

Returns:
user's given name

setGivenname

public void setGivenname(java.lang.String givenname)
Sets user's given (first) name.

Parameters:
givenname - the given name to set

getFavoriteProduct

public ExportProduct getFavoriteProduct()
Returns user's favorite (regular) product.

Returns:
the favorite propduct

setFavoriteProduct

public void setFavoriteProduct(ExportProduct favoriteProduct)
Sets user's favorite product to some ExportProduct.

Parameters:
favoriteProduct - the favorite product to set

getBalances

public UserBalance[] getBalances()
Returns user's balances in different product groups.

Returns:
user's balances in all groups

setBalances

public void setBalances(UserBalance[] balance)
Sets user's balance in all product groups.

Parameters:
balance - user's balances in all product groups.

isCancelAllowed

public boolean isCancelAllowed()
Tells if the user is allowed to cancel a previous product export transacrion.

Returns:
is the cancellation allowed

getUsername

public java.lang.String getUsername()
Returns user's username

Returns:
the username

getUserproductlist

public ExportProduct[] getUserproductlist()
Returns list of all exportable products, sorted as favoured by this user.

Returns:
the product list

setCancelAllowed

public void setCancelAllowed(boolean value)
Sets the variable that tells if the user is allowed to cancel a product export transaction. Added by Markus.

Parameters:
value - if cancelling is allowed or not

equals

public boolean equals(java.lang.Object obj)
Overrides the equals method. Compares to UserInfo objects by comparing the usernames in them.

Overrides:
equals in class java.lang.Object