[10142] | 1 | #region License Information
|
---|
| 2 |
|
---|
| 3 | /* HeuristicLab
|
---|
| 4 | * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
| 5 | *
|
---|
| 6 | * This file is part of HeuristicLab.
|
---|
| 7 | *
|
---|
| 8 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
| 9 | * it under the terms of the GNU General Public License as published by
|
---|
| 10 | * the Free Software Foundation, either version 3 of the License, or
|
---|
| 11 | * (at your option) any later version.
|
---|
| 12 | *
|
---|
| 13 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 16 | * GNU General Public License for more details.
|
---|
| 17 | *
|
---|
| 18 | * You should have received a copy of the GNU General Public License
|
---|
| 19 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 20 | */
|
---|
| 21 |
|
---|
| 22 | #endregion
|
---|
| 23 |
|
---|
| 24 | using System.Collections.Generic;
|
---|
| 25 | using HeuristicLab.Common;
|
---|
| 26 | using HeuristicLab.Core;
|
---|
| 27 |
|
---|
| 28 | namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
|
---|
| 29 | public sealed class EnumerableItem<T> : Item, IEnumerable<T> where T : struct {
|
---|
| 30 |
|
---|
| 31 | private readonly IEnumerable<T> enumerable;
|
---|
| 32 | public IEnumerable<T> Enumerable {
|
---|
| 33 | get { return enumerable; }
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 | private EnumerableItem(EnumerableItem<T> original, Cloner cloner)
|
---|
| 37 | : base(original, cloner) {
|
---|
| 38 | enumerable = original.enumerable;
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
| 42 | return new EnumerableItem<T>(this, cloner);
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | public EnumerableItem(IEnumerable<T> enumerable) {
|
---|
| 46 | this.enumerable = enumerable;
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | #region IEnumerable<T> Members
|
---|
| 50 | public IEnumerator<T> GetEnumerator() {
|
---|
| 51 | return enumerable.GetEnumerator();
|
---|
| 52 | }
|
---|
| 53 | #endregion
|
---|
| 54 |
|
---|
| 55 | #region IEnumerable Members
|
---|
| 56 | System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
|
---|
| 57 | return enumerable.GetEnumerator();
|
---|
| 58 | }
|
---|
| 59 | #endregion
|
---|
| 60 | }
|
---|
| 61 | }
|
---|