Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/RangedJsonItem.cs @ 17473

Last change on this file since 17473 was 17473, checked in by dpiringe, 4 years ago

#3026:

  • refactored inheritance structure of json items, now the default JsonItem is an abstract class without properties Value and Range -> splitted up into new interfaces
  • updated view models for new json item structure
  • updated SingleLineArrayJsonWriter
File size: 628 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6
7namespace HeuristicLab.JsonInterface {
8  public abstract class RangedJsonItem<T> : JsonItem, IRangedJsonItem<T>
9    where T : IComparable {
10    public T MinValue { get; set; }
11    public T MaxValue { get; set; }
12    public T Minimum { get; set; }
13    public T Maximum { get; set; }
14
15    protected override bool Validate() =>
16      (Minimum.CompareTo(MinValue) <= 0 && Maximum.CompareTo(MinValue) >= 0) &&
17      (Minimum.CompareTo(MaxValue) <= 0 && Maximum.CompareTo(MaxValue) >= 0);
18  }
19}
Note: See TracBrowser for help on using the repository browser.