2020-11-28 14:08:34 +01:00
|
|
|
package com.minres.scviewer.database.text;
|
2015-01-01 23:17:32 +01:00
|
|
|
|
2015-01-03 16:34: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 {
|
2021-01-02 16:15:27 +01:00
|
|
|
|
2021-01-03 14:16:56 +01:00
|
|
|
final TextDbLoader loader;
|
2015-01-01 23:17:32 +01:00
|
|
|
|
2021-01-03 14:16:56 +01:00
|
|
|
final ScvRelation scvRelation;
|
2015-01-01 23:17:32 +01:00
|
|
|
|
2021-01-03 14:16:56 +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() {
|
2021-01-03 14:16:56 +01:00
|
|
|
return scvRelation.relationType;
|
2015-01-01 23:17:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-01-06 17:14:16 +01:00
|
|
|
public ITx getSource() {
|
2021-01-03 14:16:56 +01:00
|
|
|
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() {
|
2021-01-03 14:16:56 +01:00
|
|
|
return loader.getTransaction(scvRelation.target);
|
2015-01-01 23:17:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|