public ValueVector AddValue(long time, object value, VectorConflictStrategy strategy) { if (Vector.Count == 0 || time > Time) { return(new ValueVector(time, List(value))); } if (time < Time) { // A value from the past has arrived, we're going to drop it because // we've already moved on. return(this); } if (Vector.Exists(x => x.Equals(value))) { // There's already an entry at the same time with the // same value return(this); } else { // Conflict! switch (strategy) { case VectorConflictStrategy.First: return(this); case VectorConflictStrategy.Last: return(new ValueVector(time, List(value))); case VectorConflictStrategy.Branch: return(new ValueVector(Time, Vector.Add(value))); default: throw new ArgumentException("VectorConflictStrategy not supported: " + strategy); } } }