public class Cluster extends java.lang.Object implements PrettyPrint
Contains a set of transactions and the time in which the cluster is located
Constructor and Description |
---|
Cluster(int id)
Initializes the cluster with it's identifier
|
Modifier and Type | Method and Description |
---|---|
void |
add(Transaction transaction)
Adds the transaction to the cluster
|
int |
getId()
|
Time
|
getTime()
|
int |
getTimeId()
|
java.util.HashMap<java.lang.Integer,Transaction> |
getTransactions()
|
void |
setTime(Time time)
|
java.lang.String |
toPrettyString()
Displays a prettified version of
Object.toString()
It's used as display by Debug if
it's implemented.
|
java.lang.String |
toString()
|
public Cluster(int id)
id
- cluster's identifierpublic void add(Transaction transaction)
transaction
- to addpublic int getId()
public void setTime(Time time)
time
- sets the time of the clusterpublic int getTimeId()
public java.util.HashMap<java.lang.Integer,Transaction> getTransactions()
HashMap<transactionId,
Transaction>
public java.lang.String toPrettyString()
PrettyPrint
Object.toString()
It's used as display by Debug
if it's
implemented.
toPrettyString
in
interface PrettyPrint
Object.toString()
public java.lang.String toString()
toString
in class java.lang.Object