<?php
/**
 * This file is part of the set of the DDR Simple API definition. It contains the
 * definition of the {@link PropertyValue} interface.
 * 
 * @author Sylvain Lequeux
 * @author Francois Daoust <fd@w3.org>
 * @package AskPythia
 * @subpackage Interface
 * @version $Revision: 1.12 $
 * @license http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231.html W3C Software Notice and License
 * @copyright Copyright (c) 2009, W3C (MIT, ERCIM, Keio)
 */

/**
 * {@link http://www.w3.org/TR/DDR-Simple-API/#sec-PropertyValue PropertyValue}
 * interface as defined in the {@link http://www.w3.org/TR/DDR-Simple-API/
 * DDR Simple API} standard.
 * 
 * Device Description Repositories (DDR) describe devices using properties. This
 * interface models a property (see {@link PropertyRef}) together with its value.  
 *
 * Values may be empty, in which case the method {@link exists()} returns false.
 * An attempt to query an empty value causes a {@link ValueException} as does an
 * attempt to query a value with an incompatible accessor method (string as float,
 * for example). As an exception to the rule, the {@link getString()} method must
 * return a string representation if the type of the underlying value is not
 * natively string. 
 * 
 * @author Sylvain Lequeux
 * @author Francois Daoust <fd@w3.org>
 * @package AskPythia
 * @subpackage Interface
 * @link http://www.w3.org/TR/DDR-Simple-API/ Device Description Repository Simple API
 * @version $Revision: 1.12 $
 * @license http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231.html W3C Software Notice and License
 * @copyright Copyright (c) 2009, W3C (MIT, ERCIM, Keio)
 */
interface PropertyValue {
	/**
	 * Returns the value of the property.
	 * 
	 * @return double the property value
	 * @exception ValueException empty value or incompatible accessor method
	 */
	public function getDouble();
	/**
	 * Returns the value of the property.
	 * 
	 * @return long the property value
	 * @exception ValueException empty value or incompatible accessor method
	 */
	public function getLong();
	/**
	 * Returns the value of the property, or a string representation of the
	 * property when it is not natively string.
	 * 
	 * @return string the property value
	 * @exception ValueException empty value
	 */
	public function getString();
	/**
	 * Returns the value of the property.
	 * 
	 * @return bool the property value
	 * @exception ValueException empty value or incompatible accessor method
	 */
	public function getBoolean();
	/**
	 * Returns the value of the property.
	 * 
	 * @return int the property value
	 * @exception ValueException empty value or incompatible accessor method
	 */
	public function getInteger();
	/**
	 * Returns the value of the property.
	 * 
	 * @return array(string) the property value as an array of strings
	 * @exception ValueException empty value or incompatible accessor method
	 */
	public function getEnumeration();
	/**
	 * Returns the value of the property.
	 * 
	 * @return float the property value
	 * @exception ValueException empty value or incompatible accessor method
	 */
	public function getFloat();
	
	/**
	 * Tests whether the property value is set.
	 * 
	 * @return bool true when the value is set, false otherwise.
	 */
	public function exists();
	
	/**
	 * Returns the property reference associated with the property.
	 * 
	 * @return PropertyRef the property reference of this property
	 */
	public function getPropertyRef();
}

?>