Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/27/09 14:45:44 (15 years ago)
Author:
epitzer
Message:

Migrate HL.Data-3.3 to new persistence library. (#603)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Data/3.3/ConstrainedDoubleData.cs

    r1529 r1669  
    4545    /// Initializes a new instance of <see cref="ConstrainedDoubleData"/> with default value <c>0.0</c>.
    4646    /// </summary>
    47     public ConstrainedDoubleData() : this (0.0) {
     47    public ConstrainedDoubleData()
     48      : this(0.0) {
    4849    }
    4950    /// <summary>
     
    5253    /// </summary>
    5354    /// <param name="data">The double value to represent.</param>
    54     public ConstrainedDoubleData(double data) : base() {
     55    public ConstrainedDoubleData(double data)
     56      : base() {
    5557      base.Data = new DoubleData(data);
    5658    }
     
    8486    }
    8587
    86     /// <summary>
    87     /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>.
    88     /// </summary>
    89     /// <remarks>Uses the <see cref="ConstrainedItemBase.GetXmlNode"/> implementation of base class
    90     /// <see cref="ConstrainedObjectData"/>. The double value is saved as a <see cref="DoubleData"/>
    91     /// in a child node having the tag name <c>Value</c>.</remarks>
    92     /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param>
    93     /// <param name="document">The <see cref="XmlDocument"/> where the data is saved.</param>
    94     /// <param name="persistedObjects">A dictionary of all already persisted objects. (Needed to avoid cycles.)</param>
    95     /// <returns>The saved <see cref="XmlNode"/>.</returns>
    96     public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) {
    97       XmlNode node = base.GetXmlNode(name, document, persistedObjects);
    98       node.AppendChild(PersistenceManager.Persist("Value", (DoubleData) base.Data, document, persistedObjects));
    99       return node;
    100     }
    101     /// <summary>
    102     /// Loads the persisted double value from the specified <paramref name="node"/>.
    103     /// </summary>
    104     /// <remarks>The double value must be saved in the child node as a persisted <see cref="DoubleData"/>
    105     /// having the tag name <c>Value</c> (see <see cref="GetXmlNode"/>).</remarks>
    106     /// <param name="node">The <see cref="XmlNode"/> where the double is saved.</param>
    107     /// <param name="restoredObjects">A dictionary of all already restored objects. (Needed to avoid cycles.)</param>
    108     public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) {
    109       base.Populate(node, restoredObjects);
    110       base.Data = (DoubleData)PersistenceManager.Restore(node.SelectSingleNode("Value"), restoredObjects);
    111     }
    11288  }
    11389}
Note: See TracChangeset for help on using the changeset viewer.