Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/27/09 15:29:27 (15 years ago)
Author:
epitzer
Message:

Migrate HL.Constraints-3.3 to new persistence library. (#603)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Constraints/3.3/IsIntegerConstraint.cs

    r1529 r1672  
    2525using HeuristicLab.Core;
    2626using HeuristicLab.Data;
     27using HeuristicLab.Persistence.Default.Decomposers.Storable;
    2728
    2829namespace HeuristicLab.Constraints {
     
    3031  /// Constraint that allows only integer values.
    3132  /// </summary>
    32   public class IsIntegerConstraint : ConstraintBase{
     33  [EmptyStorableClass]
     34  public class IsIntegerConstraint : ConstraintBase {
    3335    /// <inheritdoc select="summary"/>
    3436    public override string Description {
     
    4345    public override bool Check(IItem item) {
    4446      // ConstrainedIntData is always integer => just return true
    45       if(item is ConstrainedIntData)
     47      if (item is ConstrainedIntData)
    4648        return true;
    4749
    4850      // if we have an item of ConstrainedDoubleData then we check if it is integer or not
    49       if(item is ConstrainedDoubleData) {
     51      if (item is ConstrainedDoubleData) {
    5052        ConstrainedDoubleData d = (ConstrainedDoubleData)item;
    51         if(d.Data == Math.Truncate(d.Data)) {
     53        if (d.Data == Math.Truncate(d.Data)) {
    5254          return true;
    5355        } else {
Note: See TracChangeset for help on using the changeset viewer.