/** * Returns the values of wizard-components. Should return an array if children are involved, * otherwise a whatever type of object is expected. * @access public * @return mixed */ function getAllValues() { $obj = Float::withValue($this->_value ? floatval($this->_value) : 0); return $obj; }
/** * creates appropriate object from given ids * * @param Id $structureId * @param Id $partStructureId * @param String $part * @return object mixed * @access public * @since 7/21/05 */ function getPartObject($structureId, $partStructureId, $part) { $structure = $this->_destinationRepository->getRecordStructure($structureId); $partStructure = $structure->getPartStructure($partStructureId); $type = $partStructure->getType(); $typeString = $type->getKeyword(); switch ($typeString) { case "shortstring": case "string": $obj = String::withValue($part); return $obj; break; case "integer": $obj = Integer::withValue($part); return $obj; break; case "boolean": $obj = Boolean::withValue($part); return $obj; break; case "float": $obj = Float::withValue($part); return $obj; break; case "datetime": $obj = DateAndTime::fromString($part); return $obj; break; case "type": $obj = HarmoniType::fromString($part); return $obj; break; default: $this->addError("Unsupported PartStructure DataType: " . HarmoniType::typeToString($type) . "."); $false = false; return $false; } }
/** * Answer the result of dividing the receiver and aNumber. * * @param object Number $aNumber * @return object Number * @access public * @since 7/14/05 */ function dividedBy($aNumber) { $obj = Float::withValue($this->value() / $aNumber->value()); return $obj; }
/** * Convert this object to a StorableFloat * * @return object * @access public * @since 6/9/06 */ function asAFloat() { return Float::withValue($this->getValue() ? 1 : 0); }
/** * Answer a floating-point number approximating the receiver. * * @return object Float * @access public * @since 7/14/05 */ function asFloat() { $obj = Float::withValue(floatval($this->value())); return $obj; }
/** * Convert this object to a StorableFloat * * @return object * @access public * @since 6/9/06 */ function asAFloat() { $tstamp = $this->asTimestamp(); return Float::withValue($tstamp->asUnixTimeStamp()); }
/** * Answer a new object with the value specified * * @param mixed $value * @param optional string $class The class to instantiate. Do NOT use outside * of this package. * @return object Double * @access public * @since 7/14/05 * @static */ static function withValue($value, $class = 'Double') { return parent::withValue($value, $class); }