//****************************************************************************************************** // RoutingTablesAdaptersList.cs - Gbtc // // Copyright © 2016, Grid Protection Alliance. All Rights Reserved. // // Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See // the NOTICE file distributed with this work for additional information regarding copyright ownership. // The GPA licenses this file to you under the MIT License (MIT), the "License"; you may // not use this file except in compliance with the License. You may obtain a copy of the License at: // // http://www.opensource.org/licenses/MIT // // Unless agreed to in writing, the subject software distributed under the License is distributed on an // "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the // License for the specific language governing permissions and limitations. // // Code Modification History: // ---------------------------------------------------------------------------------------------------- // 06/29/2016 - Steven E. Chisholm // Generated original version of source code. // //****************************************************************************************************** using System.Collections.Generic; using System.Linq; namespace GSF.TimeSeries.Adapters { /// /// Indicates how the have changed from one route calculation to another. /// public class RoutingTablesAdaptersList { /// /// A list of all that did NOT existed in the old route calculation, but do exist in the new route calculation. /// public readonly List NewAdapter; /// /// A list of all that existed in the old route calculation, and also exist in the new route calculation. /// public readonly List ExistingAdapter; /// /// A list of all that existed in the old route calculation, but do NOT exist in the new route calculation. /// public readonly List OldAdapter; /// /// A union of with . /// public readonly List NewAndExistingAdapters; /// /// Creates a /// /// A complete list of all the adapters that existed before. /// A complete list of all the adapters that exist now public RoutingTablesAdaptersList(HashSet previousAdapterList, HashSet currentAdapterList) { NewAdapter = new List(); ExistingAdapter = new List(); OldAdapter = new List(); NewAndExistingAdapters = new List(); NewAndExistingAdapters.AddRange(currentAdapterList); NewAdapter.AddRange(currentAdapterList.Where(x => !previousAdapterList.Contains(x))); OldAdapter.AddRange(previousAdapterList.Where(x => !currentAdapterList.Contains(x))); ExistingAdapter.AddRange(currentAdapterList.Where(x => previousAdapterList.Contains(x))); } } }