SCViewer/plugins/com.minres.scviewer.databas.../src/com/minres/scviewer/database/text/TxRelation.java

34 lines
706 B
Java
Raw Normal View History

2020-11-28 14:08:34 +01:00
package com.minres.scviewer.database.text;
2015-01-01 23:17:32 +01:00
import com.minres.scviewer.database.RelationType;
2020-11-28 14:47:43 +01:00
import com.minres.scviewer.database.tx.ITx;
import com.minres.scviewer.database.tx.ITxRelation;
2015-01-01 23:17:32 +01:00
2021-01-03 17:44:52 +01:00
class TxRelation implements ITxRelation {
final TextDbLoader loader;
2015-01-01 23:17:32 +01:00
final ScvRelation scvRelation;
2015-01-01 23:17:32 +01:00
public TxRelation(TextDbLoader loader, ScvRelation scvRelation) {
this.loader = loader;
this.scvRelation = scvRelation;
2015-01-01 23:17:32 +01:00
}
@Override
public RelationType getRelationType() {
return scvRelation.relationType;
2015-01-01 23:17:32 +01:00
}
@Override
2015-01-06 17:14:16 +01:00
public ITx getSource() {
return loader.getTransaction(scvRelation.source);
2015-01-01 23:17:32 +01:00
}
@Override
2015-01-06 17:14:16 +01:00
public ITx getTarget() {
return loader.getTransaction(scvRelation.target);
2015-01-01 23:17:32 +01:00
}
}