//==================================================================================================
// P r o g r a m                                                                               Java
// S o l v e _ t e n s i o n
// D u r a t i o n P r o p e r t y
//                                                                                By Bruno Bachelet
//==================================================================================================
// Copyright (c) 1999-2016
// Bruno Bachelet - bruno@nawouak.net - http://www.nawouak.net
//
// This file is part of the B++ Library. This library is free software; you can redistribute it
// and/or modify it under the terms of the GNU Library General Public License as published by the
// Free Software Foundation; either version 2 of the License, or (at your option) any later
// version.
//
// This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
// the GNU Library General Public License for more details (http://www.gnu.org).

/*DESCRIPTION*/
/* This module provides a class to model a <CODE>formatter.model.time.TF_Duration</CODE>
   additional property for extendable objects. The <CODE>TF_Duration</CODE> class allows to store
   an ideal duration and can be extended to support both unflexible and flexible durations.
   Flexible durations are useful when computing temporally-adaptive presentations. The module has
   originally been written by Rogério F. Rodrigues
   (<A HREF="http://www.telemidia.puc-rio.br/" TARGET="new_window">Laboratório
   TeleMídia</A>). */

// Package //---------------------------------------------------------------------------------------
package bpp.program.solve_tension;

// Importation //-----------------------------------------------------------------------------------
import bpp.data_structure.extension.Property;
import formatter.model.time.TF_Duration;

// D u r a t i o n P r o p e r t y  Class //--------------------------------------------------------
/*CLASS DurationProperty */
/* Represents a duration additional property for extendable objects. It wraps a value of the
   class <CODE>formatter.model.time.TF_Duration</CODE> in an object. */
public class DurationProperty implements Property {
 //---------------------------------------------------------------------------------------Attributes
 protected TF_Duration atDuration;
 //--------------------------------------------------------------------------------------Constructor
 /*METHOD DurationProperty */ /* Builds a property that encapsulates a duration object. */
 public DurationProperty(TF_Duration agDuration) { atDuration=agDuration; }
 //--------------------------------------------------------------------------------------GetDuration
 /*METHOD DurationProperty */
 /* Returns the duration object encapsulated inside the property object. */
 public TF_Duration getDuration() { return (atDuration); }
 //--------------------------------------------------------------------------------------SetDuration
 /*METHOD DurationProperty */
 /* Sets the duration object to be encapsulated inside the property object. */
 public void setDuration(TF_Duration agDuration) { atDuration=agDuration; }
 //----------------------------------------------------------------------------------------Duplicate
 /*METHOD DurationProperty */ /* Duplicates the property. */
 public Property duplicate()
 { return (new DurationProperty((TF_Duration)atDuration.duplicate())); }
 //-----------------------------------------------------------------------------------------ToString
 /*METHOD DurationProperty */
 /* Returns a string that fully describes the state of the property. */
 public String toString() { return (atDuration.toString()); }
 //---------------------------------------------------------------------------------------FromString
 /*METHOD DurationProperty */
 /* Changes the state of the property according to the description provided by a given string. */
 public void fromString(String agString) { atDuration.fromString(agString); }
}

// End //-------------------------------------------------------------------------------------------