Last change
on this file since 3002 was
1958,
checked in by epitzer, 16 years ago
|
Updated handling of floating and fixed point numbers, faster and more accurate serialization and parsing. (#646)
|
File size:
795 bytes
|
Line | |
---|
1 | using System.Collections;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System;
|
---|
4 | using HeuristicLab.Persistence.Core;
|
---|
5 | using HeuristicLab.Persistence.Default.Xml.Primitive;
|
---|
6 |
|
---|
7 | namespace HeuristicLab.Persistence.Default.Xml.Compact {
|
---|
8 |
|
---|
9 | public class DoubleList2XmlSerializer : NumberEnumeration2XmlSerializerBase<List<double>> {
|
---|
10 |
|
---|
11 | protected override void Add(IEnumerable enumeration, object o) {
|
---|
12 | ((List<double>)enumeration).Add((double)o);
|
---|
13 | }
|
---|
14 |
|
---|
15 | protected override IEnumerable Instantiate() {
|
---|
16 | return new List<double>();
|
---|
17 | }
|
---|
18 |
|
---|
19 | protected override string FormatValue(object o) {
|
---|
20 | return Double2XmlSerializer.FormatG17((double)o);
|
---|
21 | }
|
---|
22 |
|
---|
23 | protected override object ParseValue(string o) {
|
---|
24 | return Double2XmlSerializer.ParseG17(o);
|
---|
25 | }
|
---|
26 |
|
---|
27 | }
|
---|
28 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.