Abstract Class PelEntryNumber

Description

Class for holding numbers.

This class can hold numbers, with range checks.

Located in /PelEntryNumber.php (line 77)

PelEntry
   |
   --PelEntryNumber
Direct descendents
Class Description
 class PelEntryShort Class for holding signed shorts.
 class PelEntrySShort Class for holding signed shorts.
 class PelEntryLong Class for holding unsigned longs.
 class PelEntrySLong Class for holding signed longs.
 class PelEntryByte Class for holding unsigned bytes.
 class PelEntrySByte Class for holding signed bytes.
Variable Summary
 int $max
 int $min
 array $value
Method Summary
 void addNumber (int|array $n)
 string formatNumber (int $number, [boolean $brief = false])
 string getBytes (PelByteOrder $o)
 string getText ([boolean $brief = false])
 int|array getValue ()
 string numberToBytes (int $number, PelByteOrder $order)
 void setValue (int|array $value...)
 void setValueArray (array $value)
 void validateNumber (int|array $n)
Variables
int $dimension = 1 (line 114)

The dimension of the number held.

Normal numbers have a dimension of one, pairs have a dimension of two, etc.

  • access: protected
int $max (line 104)

The maximum allowed value.

Any attempt to change the value over this variable will result in a PelOverflowException being thrown.

  • access: protected
int $min (line 94)

The minimum allowed value.

Any attempt to change the value below this variable will result in a PelOverflowException being thrown.

  • access: protected
array $value = array() (line 84)

The value held by this entry.

  • access: protected

Inherited Variables

Inherited from PelEntry

PelEntry::$bytes
PelEntry::$components
PelEntry::$format
PelEntry::$ifd_type
PelEntry::$tag
Methods
addNumber (line 215)

Add a number.

This appends a number to the numbers already held by this entry, thereby increasing the number of components by one.

void addNumber (int|array $n)
  • int|array $n: the number to be added.
formatNumber (line 280)

Format a number.

This method is called by getText to format numbers. Subclasses should override this method if they need more sophisticated behavior than the default, which is to just return the number as is.

  • return: the number formatted as a string suitable for display.
string formatNumber (int $number, [boolean $brief = false])
  • int $number: the number which will be formatted.
  • boolean $brief: it could be that there is both a verbose and a brief formatting available, and this argument controls that.

Redefined in descendants as:
getBytes (line 249)

Turn this entry into bytes.

  • return: bytes representing this entry.
string getBytes (PelByteOrder $o)

Redefinition of:
PelEntry::getBytes()
Turn this entry into bytes.
getText (line 294)

Get the numeric value of this entry as text.

  • return: the numbers(s) held by this entry.
string getText ([boolean $brief = false])
  • boolean $brief: use brief output? The numbers will be separated by a single space if brief output is requested, otherwise a space and a comma will be used.

Redefinition of:
PelEntry::getText()
Get the value of this entry as text.

Redefined in descendants as:
getValue (line 170)

Return the numeric value held.

  • return: this will either be a single number if there is only one component, or an array of numbers otherwise.
int|array getValue ()

Redefinition of:
PelEntry::getValue()
Get the value of this entry.
numberToBytes (line 237)

Convert a number into bytes.

The concrete subclasses will have to implement this method so that the numbers represented can be turned into bytes.

The method will be called once for each number held by the entry.

  • return: bytes representing the number given.
  • abstract:
string numberToBytes (int $number, PelByteOrder $order)

Redefined in descendants as:
setValue (line 136)

Change the value.

This method can change both the number of components and the value of the components. Range checks will be made on the new value, and a PelOverflowException will be thrown if the value is found to be outside the legal range.

The method accept several number arguments. The getValue method will always return an array except for when a single number is given here.

void setValue (int|array $value...)
  • int|array $value...: the new value(s). This can be zero or more numbers, that is, either integers or arrays. The input will be checked to ensure that the numbers are within the valid range. If not, then a PelOverflowException will be thrown.

Redefinition of:
PelEntry::setValue()
Set the value of this entry.
setValueArray (line 155)

Change the value.

This method can change both the number of components and the value of the components. Range checks will be made on the new value, and a PelOverflowException will be thrown if the value is found to be outside the legal range.

void setValueArray (array $value)
  • array $value: the new values. The array must contain the new numbers.
validateNumber (line 191)

Validate a number.

This method will check that the number given is within the range given my getMin() and getMax(), inclusive. If not, then a PelOverflowException is thrown.

  • return: nothing, but will throw a PelOverflowException if the number is found to be outside the legal range and Pel::$strict is true.
void validateNumber (int|array $n)
  • int|array $n: the number in question.

Inherited Methods

Inherited From PelEntry

 PelEntry::getBytes()
 PelEntry::getComponents()
 PelEntry::getFormat()
 PelEntry::getIfdType()
 PelEntry::getTag()
 PelEntry::getText()
 PelEntry::getValue()
 PelEntry::setIfdType()
 PelEntry::setValue()
 PelEntry::__toString()

Documentation generated on Tue, 19 Dec 2006 01:08:20 +0100 by phpDocumentor 1.3.0 SourceForge.net Logo