Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/DoubleArray2XmlFormatters.cs @ 1564

Last change on this file since 1564 was 1564, checked in by epitzer, 15 years ago

Stronger typing for formatters with the help of generics. Separate format and serial data type. (#548)

File size: 832 bytes
Line 
1using System;
2using HeuristicLab.Persistence.Core;
3using System.Globalization;
4
5namespace HeuristicLab.Persistence.Default.Xml.Compact {
6 
7  public abstract class DoubleArray2XmlFormatterBase<T> : NumberArray2XmlFormatterBase<T> {
8   
9    protected override string FormatValue(object o) {
10      return ((double)o).ToString("r", CultureInfo.InvariantCulture);
11    }
12
13    protected override object ParseValue(string o) {
14      return double.Parse(o);
15    }
16  }
17
18  [EmptyStorableClass]
19  public class Double1DArray2XmlFormatter : DoubleArray2XmlFormatterBase<double[]> { }
20
21
22  [EmptyStorableClass]
23  public class Double2DArray2XmlFormatter : DoubleArray2XmlFormatterBase<double[,]> { }
24
25  [EmptyStorableClass]
26  public class Double3DArray2XmlFormatter : DoubleArray2XmlFormatterBase<double[,,]> { }
27 
28}
Note: See TracBrowser for help on using the repository browser.