Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/27/20 15:45:50 (4 years ago)
Author:
mkommend
Message:

#2971: Minor changes in interval collection and interval interpreter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/IntervalCollection.cs

    r17506 r17564  
    2222using System;
    2323using System.Collections.Generic;
     24using System.Linq;
    2425using HEAL.Attic;
    2526using HeuristicLab.Common;
     
    5152      }
    5253    }
     54
     55    public int Count => intervals.Count;
    5356
    5457    public IntervalCollection() : base() { }
     
    8790    }
    8891
    89     public IDictionary<string, Interval> GetIntervals() {
    90       return intervals;
     92    public IReadOnlyDictionary<string, Interval> GetReadonlyDictionary() {
     93      return intervals.ToDictionary(pair => pair.Key, pair => pair.Value);
     94    }
     95
     96    public IEnumerable<Tuple<string, Interval>> GetVariableIntervals() {
     97      foreach (var variableInterval in intervals)
     98        yield return Tuple.Create(variableInterval.Key, variableInterval.Value);
    9199    }
    92100  }
Note: See TracChangeset for help on using the changeset viewer.