All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class shimmer.Record

java.lang.Object
   |
   +----shimmer.Record

public class Record
extends Object
implements Serializable
Class Record,a collection of RecordEntry, is a Record database of an assignment that stores submission record of each user using loginname as a key. Only latest submission will be maintained in the Record database. Record usually saved in .record file.

Version:
1.1 -- 9 Dec 1998
Author:
Kulawat Wongsaroj

Variable Index

 o recordTable
Hashtable that stores RecordEntry using loginname as a key
 o serialVersionUID
To maintain class versioning

Constructor Index

 o Record()
Constructor of Record

Method Index

 o addEntry(String, String, RecordEntry)
Add a RecordEntry object in the Record database with loginname as a key
 o getEntry(String)
Get RecordEntry of a user
 o getResubmissionQuota(String)
Get resubmission quota of a user.
 o getTable()
Get Record database
 o load(String)
Load Record database file and return Record object
 o put(String, RecordEntry)
Put a RecordEntry object in the Record database with loginname as a key
 o save(String)
Save the Record database to specific filename (.record).

Variables

 o serialVersionUID
 static final long serialVersionUID
To maintain class versioning

 o recordTable
 private Hashtable recordTable
Hashtable that stores RecordEntry using loginname as a key

Constructors

 o Record
 public Record()
Constructor of Record

Methods

 o put
 private void put(String loginname,
                  RecordEntry entry)
Put a RecordEntry object in the Record database with loginname as a key

Parameters:
loginname - loginname, key of RecordEntry
entry - RecordEntry of this user
 o addEntry
 public static void addEntry(String recordFilename,
                             String loginname,
                             RecordEntry entry)
Add a RecordEntry object in the Record database with loginname as a key

Parameters:
recordFilename - Record database file
loginname - loginname of user, key of RecordEntry
entry - RecordEntry of this user
 o getEntry
 public RecordEntry getEntry(String loginname)
Get RecordEntry of a user

Parameters:
loginname - loginname of user
Returns:
RecordEntry of this user
 o getResubmissionQuota
 public int getResubmissionQuota(String loginname)
Get resubmission quota of a user. base on assumption that all loginame that entered is valid, if loginname is not found in the Record database, this user maybe just added to loginname list (passwd.dat) and has no record in the Record database yet. Therefore, return a special value for this case which is -2.

Parameters:
loginname - loginname of user
Returns:
resubmission quota (-2 if no entry found)
 o getTable
 public Hashtable getTable()
Get Record database

Returns:
Hashtable of Record database
 o save
 private void save(String filename)
Save the Record database to specific filename (.record).

Parameters:
filename - .record filename
 o load
 public static Record load(String filename)
Load Record database file and return Record object

Parameters:
filename - Record database filename
Returns:
Record object

All Packages  Class Hierarchy  This Package  Previous  Next  Index