Free cookie consent management tool by TermsFeed Policy Generator

source: branches/New Persistence Exploration/Persistence/Persistence/Interfaces/IFormatter.cs @ 1407

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

Abstract base class for formats to ensure comparability. (#506)

File size: 562 bytes
Line 
1using System;
2
3namespace HeuristicLab.Persistence.Interfaces {
4
5  public interface IFormat {
6    string Name { get; }
7  }
8
9  public abstract class Format : IFormat {
10    public abstract string Name { get;  }
11    public override bool Equals(object obj) {
12      return Name == ((Format) obj).Name;
13    }
14    public override int GetHashCode() {
15      return Name.GetHashCode();
16    }
17  }
18
19  public interface IFormatter {
20    Type Type { get; }
21    IFormat Format { get; }
22    object DoFormat(object o);
23    object Parse(object o);
24  }
25
26}
Note: See TracBrowser for help on using the repository browser.