core_lib
Class Transaction

java.lang.Object
  extended by core_lib.Transaction

public class Transaction
extends java.lang.Object

The Transaction class stores the parameters that characterize a transaction between two users. Only access methods are provided.


Field Summary
private  int commit_cycle
          Cycle when this Transaction will complete and data can be committed.
private  int file_num
          Numerical identifier for the file being exchanged.
private  int receiver
          Numerical identifier for the file receiver.
private  int sender
          Numerical identifier for the file provider.
private  boolean valid
          Validity of the file being exchanged.
 
Constructor Summary
Transaction(int commit_cycle, int sender, int receiver, int file_num, boolean valid)
          Construct a Transaction object by providing all fields.
 
Method Summary
 int getCommit()
          Get the commit cycle of this Transaction.
 int getFile()
          Get the identifier of the file being exchanged
 int getRecv()
          Get the identifier of the file receiver
 int getSend()
          Get the identifier of the file provider
 boolean getValid()
          Get the validity of the file being exchanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commit_cycle

private int commit_cycle
Cycle when this Transaction will complete and data can be committed.


sender

private int sender
Numerical identifier for the file provider.


receiver

private int receiver
Numerical identifier for the file receiver.


file_num

private int file_num
Numerical identifier for the file being exchanged.


valid

private boolean valid
Validity of the file being exchanged.

Constructor Detail

Transaction

public Transaction(int commit_cycle,
                   int sender,
                   int receiver,
                   int file_num,
                   boolean valid)
Construct a Transaction object by providing all fields.

Parameters:
commit_cycle - Cycle when this transaction can commit
sender - File provider
receiver - File receiver
file_num - File being exchanged
valid - Validity of file being exchanged
Method Detail

getCommit

public int getCommit()
Get the commit cycle of this Transaction.

Returns:
The commit cycle of this Transaction

getSend

public int getSend()
Get the identifier of the file provider

Returns:
The identifier of the file provider

getRecv

public int getRecv()
Get the identifier of the file receiver

Returns:
The identifier of the file receiver

getFile

public int getFile()
Get the identifier of the file being exchanged

Returns:
The identifier of the file being exchanged

getValid

public boolean getValid()
Get the validity of the file being exchanged

Returns:
The validity of the file being exchanged