refactor internal transaction representation

This commit is contained in:
2021-01-03 14:16:56 +01:00
parent b44f3418f4
commit 85ce07f11f
15 changed files with 373 additions and 287 deletions
@@ -12,31 +12,28 @@ class TxRelation implements ITxRelation, Serializable {
*/
private static final long serialVersionUID = -347668857680574140L;
final Tx source;
final TextDbLoader loader;
final Tx target;
final ScvRelation scvRelation;
final RelationType relationType;
public TxRelation(RelationType relationType, Tx source, Tx target) {
this.source = source;
this.target = target;
this.relationType = relationType;
public TxRelation(TextDbLoader loader, ScvRelation scvRelation) {
this.loader = loader;
this.scvRelation = scvRelation;
}
@Override
public RelationType getRelationType() {
return relationType;
return scvRelation.relationType;
}
@Override
public ITx getSource() {
return source;
return loader.getTransaction(scvRelation.source);
}
@Override
public ITx getTarget() {
return target;
return loader.getTransaction(scvRelation.target);
}
}