Free cookie consent management tool by TermsFeed Policy Generator

source: branches/Operator Architecture Refactoring/HeuristicLab.Core/3.3/Parameter.cs @ 2042

Last change on this file since 2042 was 2042, checked in by swagner, 15 years ago

Refactoring of the operator architecture (#95)

File size: 2.3 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
24using System.Text;
25using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
26
27namespace HeuristicLab.Core {
28  public class Parameter : ItemBase, IParameter {
29    [Storable]
30    private string myName;
31    public string Name {
32      get { return myName; }
33    }
34
35    [Storable]
36    private string myDescription;
37    public string Description {
38      get { return myDescription; }
39    }
40
41    [Storable]
42    private Type myDataType;
43    public Type DataType {
44      get { return myDataType; }
45    }
46
47    [Storable]
48    private ParamterType myType;
49    public ParamterType Type {
50      get { return myType; }
51    }
52
53    public Parameter() {
54      myName = "Anonymous";
55      myDescription = "";
56      myDataType = null;
57      myType = ParamterType.In;
58    }
59    public Parameter(string name, string description, Type dataType, ParamterType type)
60      : this() {
61      myName = name;
62      myDescription = description;
63      myDataType = dataType;
64      myType = type;
65    }
66
67    public override IView CreateView() {
68      return new ParameterView(this);
69    }
70
71    public override ICloneable Clone(ICloner cloner) {
72      Parameter clone = new Parameter();
73      cloner.AddClonedObject(this, clone);
74      clone.myName = Name;
75      clone.myDescription = Description;
76      clone.myDataType = DataType;
77      clone.myType = Type;
78      return clone;
79    }
80  }
81}
Note: See TracBrowser for help on using the repository browser.