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 |
|
---|
22 | using System;
|
---|
23 | using System.Collections.Generic;
|
---|
24 | using System.Text;
|
---|
25 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
26 |
|
---|
27 | namespace 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 | }
|
---|