Last change
on this file since 5155 was
1996,
checked in by mstoeger, 16 years ago
|
implemented IStorable and made use of the PersistenceManager wherever possible. #639
|
File size:
419 bytes
|
Line | |
---|
1 | using System;
|
---|
2 | using HeuristicLab.Core;
|
---|
3 |
|
---|
4 | namespace HeuristicLab.Visualization.LabelProvider {
|
---|
5 | public class DiscreteLabelProvider : StorableBase, ILabelProvider {
|
---|
6 | public string GetLabel(double value) {
|
---|
7 | int index = (int)Math.Round(value);
|
---|
8 | double delta = Math.Abs(index - value);
|
---|
9 |
|
---|
10 | if (delta < 1e-10)
|
---|
11 | return index.ToString();
|
---|
12 | else
|
---|
13 | return string.Empty;
|
---|
14 | }
|
---|
15 | }
|
---|
16 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.