Last change
on this file since 1454 was
1454,
checked in by epitzer, 15 years ago
|
merge persistence exploration branch into trunk as HL plugin. (#506)
|
File size:
980 bytes
|
Rev | Line | |
---|
[1454] | 1 | using System;
|
---|
| 2 | using HeuristicLab.Persistence.Core;
|
---|
| 3 | using System.Globalization;
|
---|
| 4 |
|
---|
| 5 | namespace HeuristicLab.Persistence.Default.Xml.Compact {
|
---|
| 6 |
|
---|
| 7 | [EmptyStorableClass]
|
---|
| 8 | public class DoubleArray2XmlFormatter : NumberArray2XmlFormatter {
|
---|
| 9 |
|
---|
| 10 | public override Type Type {
|
---|
| 11 | get {
|
---|
| 12 | return typeof(double[]);
|
---|
| 13 | }
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | protected override string formatValue(object o) {
|
---|
| 17 | return ((double)o).ToString("r", CultureInfo.InvariantCulture);
|
---|
| 18 | }
|
---|
| 19 |
|
---|
| 20 | protected override object parseValue(string o) {
|
---|
| 21 | return double.Parse(o);
|
---|
| 22 | }
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | [EmptyStorableClass]
|
---|
| 26 | public class Double2DArray2XmlFormatter : DoubleArray2XmlFormatter {
|
---|
| 27 | public override Type Type {
|
---|
| 28 | get {
|
---|
| 29 | return typeof(double[,]);
|
---|
| 30 | }
|
---|
| 31 | }
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | [EmptyStorableClass]
|
---|
| 35 | public class Double3DArray2XmlFormatter : DoubleArray2XmlFormatter {
|
---|
| 36 | public override Type Type {
|
---|
| 37 | get {
|
---|
| 38 | return typeof(double[, ,]);
|
---|
| 39 | }
|
---|
| 40 | }
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.