Rev | Line | |
---|
[16565] | 1 | using HEAL.Attic;
|
---|
| 2 | #region License Information
|
---|
[2572] | 3 | /* HeuristicLab
|
---|
[16565] | 4 | * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
[2572] | 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 | #endregion
|
---|
| 22 |
|
---|
| 23 | namespace HeuristicLab.Collections {
|
---|
[16565] | 24 | [StorableType(StorableMemberSelection.AllFields, "0a9d0728-5fdc-4e16-b02b-545dbdf0b0fa")]
|
---|
[2572] | 25 | public struct IndexedItem<T> {
|
---|
[14786] | 26 | private readonly int index;
|
---|
[2572] | 27 | public int Index {
|
---|
| 28 | get { return index; }
|
---|
| 29 | }
|
---|
[14786] | 30 | private readonly T value;
|
---|
[2572] | 31 | public T Value {
|
---|
| 32 | get { return value; }
|
---|
| 33 | }
|
---|
| 34 |
|
---|
| 35 | public IndexedItem(int index, T value) {
|
---|
| 36 | this.index = index;
|
---|
| 37 | this.value = value;
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | public override string ToString() {
|
---|
[14786] | 41 | return "[" + index + ": " + (value == null ? "null" : value.ToString()) + "]";
|
---|
[2572] | 42 | }
|
---|
| 43 | }
|
---|
| 44 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.