Class org.as2lib.io.file.BitFormat

org.as2lib.core.BasicClass
   +--org.as2lib.io.file.BitFormat

Description

Formater for bit. This class gets used for formatting bits in Kilo/Mega/Giga/Tera bits.

Method Index

new BitFormat()

getBit(), getBytes(), getGigaBit(), getGigaBytes(), getKiloBit(), getKiloBytes(), getMegaBit(), getMegaBytes(), getTeraBit(), getTeraBytes(), setFloatingPoints(), toString()

Constructor Detail

BitFormat

public function BitFormat(bit:Number)

Constructs a new BitFormat

Parameters

bitBit to be formatted.

Method Detail

setFloatingPoints

public function setFloatingPoints(fp:Number):BitFormat

Sets the used amount of values after the comma.

Parameters

fpAmount of characters after the floating point.

Return

The current instance for faster access.

Throws

IllegalArgumentExceptionif you pass

getBit

public function getBit(Void):Number

Getter for the value in bit.

Return

Value in bit.

getBytes

public function getBytes(Void):Number

Getter for the value in bytes.

Return

Value in bytes.

getKiloBit

public function getKiloBit(Void):Number

Getter for the value in kilobit.

Return

Value in kilobit.

getKiloBytes

public function getKiloBytes(Void):Number

Getter for the value in kilobytes.

Return

Value in kilobytes.

getMegaBit

public function getMegaBit(Void):Number

Getter for the value in megabit.

Return

Value in megabit.

getMegaBytes

public function getMegaBytes(Void):Number

Getter for the value in megabytes.

Return

Value in megabytes.

getGigaBit

public function getGigaBit(Void):Number

Getter for the value in gigabit.

Return

Value in gigabit.

getGigaBytes

public function getGigaBytes(Void):Number

Getter for the value in gigabytes.

Return

Value in gigabytes.

getTeraBit

public function getTeraBit(Void):Number

Getter for the value in terabit.

Return

Value in terabit.

getTeraBytes

public function getTeraBytes(Void):Number

Getter for the value in terabytes.

Return

Value in terabytes.

toString

public function toString():String

Extended toString method for a well formatted bitvalue. This method uses the next matching size and adds the matching Shortname for it. Examples: new BitFormat(1).toString(); // 1b new BitFormat(1234).toString(); // 1.21Kb new BitFormat(15002344).toString(); // 14.31Mb

Return

bits as string with correct ending.

Specified By

toString() in org.as2lib.core.BasicInterface

Overrides

toString() in org.as2lib.core.BasicClass