public object GetValue(long attime)
{
if (this.committedValues.ContainsKey(attime))
return this.committedValues[attime];
long candidateTime = 0;
object candidateValue = this.trobj.InnerObject[this.position];
foreach (long time in this.committedValues.Keys)
//// TODO review if time is negative
if (attime > time && candidateTime < time)
{
candidateTime = time;
candidateValue = this.committedValues[time];
}
return candidateValue;
}
TransactionalValue::GetValue ( |
public void SetAndGetOriginalValue() { IObject obj = new BaseObject(null, new object[] { 1, 2, 3 }); TransactionalValue tvalue = new TransactionalValue(this.trobj, 2); Assert.AreEqual(3, tvalue.GetValue(this.CreateTransaction())); Assert.AreEqual(3, tvalue.GetValue(0)); }