refactor internal transaction representation
This commit is contained in:
+8
-11
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user