Fixed inconsitencies

This commit is contained in:
2015-01-09 09:16:40 +01:00
parent 4062d24897
commit cb77a5da33
26 changed files with 174 additions and 73 deletions

View File

@ -35,6 +35,7 @@ class Tx implements ITx {
Tx(int id, TxStream stream, TxGenerator generator, EventTime begin){
this.id=id
this.stream=stream
this.generator=generator
this.beginTime=begin
}
@ -48,5 +49,10 @@ class Tx implements ITx {
public Collection<ITxRelation> getOutgoingRelations() {
return outgoingRelations;
}
@Override
public int compareTo(ITx o) {
return beginTime.compareTo(o.beginTime)
}
}

View File

@ -33,7 +33,7 @@ class TxStream extends HierNode implements ITxStream {
def generators = [];
private allTransactions;
private TreeSet<Tx> allTransactions;
TxStream(int id, TextDb db, String name, String kind){
super(name)
@ -68,9 +68,11 @@ class TxStream extends HierNode implements ITxStream {
}
@Override
public List<ITx> getTransactions() {
if(!allTransactions)
allTransactions=generators.transactions.flatten().sort{it.beginTime.value}
public NavigableSet<ITx> getTransactions() {
if(!allTransactions){
allTransactions=new TreeSet<Tx>()
allTransactions.addAll(generators.transactions.flatten())
}
return allTransactions
}