Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PrintDigits

PrintDigits class

This class contains all methods to convert digits to strings and prints them out.

Hierarchy

Index

Constructors

constructor

  • new PrintDigits(_framework?: boolean, _largeDigits?: boolean): PrintDigits
  • Create an instance of printDigits You don't have to fill in the arguments

    the default values of : framework = false largeDigits = false

    Parameters

    • Default value _framework: boolean = false
    • Default value _largeDigits: boolean = false

    Returns PrintDigits

Properties

Protected DigitConverter

DigitConverter: DigitConverter = new DigitConverter()

digitsHeight attribute

param

Message that will be managed by this PrintDigits class

access

protected

Private _framework

_framework: boolean

Private _largeDigits

_largeDigits: boolean

Private digitsHeight

digitsHeight: number = 3

digitsHeight attribute

param

Message that will be managed by this PrintDigits class

access

private

Accessors

Private framework

  • get framework(): boolean
  • Framework

    this method returns the _framework value

    This is inserted to meet Single Responsibility/managing dependencies

    access

    private

    Returns boolean

    boolean

Private getDigitsHeight

  • get getDigitsHeight(): number
  • get digit height

    this method returns the digit height

    access

    private

    Returns number

    digit height number

Private largeDigits

  • get largeDigits(): boolean
  • large Digits

    this method returns the _largeDigits value

    This is inserted to meet Single Responsibility/managing dependencies

    access

    public

    Returns boolean

    boolean

Methods

disableFramework

  • disableFramework(): void
  • disable Framework

    this method disable framework ( false)

    true = see framework false = hide framework

    access

    public

    Returns void

disableLargeLetters

  • disableLargeLetters(): void
  • disable Large Digits

    this method disable large Digits ( false)

    true = large digits false = normal digits

    access

    public

    Returns void

enableFramework

  • enableFramework(): void
  • enable Framework

    this method enables framework ( true)

    true = see framework false = hide framework

    access

    public

    Returns void

enableLargeDigits

  • enableLargeDigits(): void
  • enable Large Digits

    this method enable large Digits ( true)

    true = large digits false = normal digits

    access

    public

    Returns void

Private frameworkBottom

  • frameworkBottom(digits: Digit[]): string
  • framework bottom

    returns the bottom side for the framework

    access

    private

    Parameters

    Returns string

    string contains framework bottom side

Private frameworkLeft

  • frameworkLeft(): string
  • framework left

    returns the left side for the framework

    access

    private

    Returns string

    string contains framework left side

Private frameworkRight

  • frameworkRight(): string
  • framework right

    returns the right side for the framework

    access

    private

    Returns string

    string contains framework right side

Private frameworkTop

  • frameworkTop(digits: Digit[]): string
  • framework top

    returns the top side for the framework

    access

    private

    Parameters

    Returns string

    string contains framework top

getFramework

  • getFramework(): boolean
  • get framework

    this method returns the framework value

    true = see framework false = hide framework

    access

    public

    Returns boolean

    boolean

getLargeDigits

  • getLargeDigits(): boolean
  • get large Digits

    this method returns the largeDigits value

    true = large digits false = normal digits

    access

    private

    Returns boolean

    boolean

Private initDigitHeight

  • initDigitHeight(): void
  • initializes the digits height

    this method intitializes the digitHeight

    digitheight for normal sized digits : 3

    digitheight for large sized digits : 7

    access

    private

    Returns void

intitialize

  • intitialize(framework: boolean, largeDigits: boolean): void
  • Initializer

    Initializes the instance of the printDigit with framework and largeDigit.

    access

    public

    Parameters

    • framework: boolean
    • largeDigits: boolean

    Returns void

    void

Private isDigitSpace

  • isDigitSpace(digit: Digit): boolean
  • is Digit Space

    checks if the given digit is only space

    access

    private

    Parameters

    Returns boolean

Private layerFourAndFiveLarge

  • layerFourAndFiveLarge(digit: Digit): string
  • layer four and five large

    returns layer four and five from a digit based on the given digit values

    This for large sized digits

    values : e, c

    access

    private

    Parameters

    Returns string

    string contains a digit layer

Private layerOne

  • layerOne(digit: Digit): string
  • layer one

    returns layer one from a digit based on the given digit values

    This for normal sized digits

    values : f, g, b

    access

    private

    Parameters

    Returns string

    string contains a digit layer

Private layerOneAndTwoLarge

  • layerOneAndTwoLarge(digit: Digit): string
  • layer one and two large

    returns layer one and two from a digit based on the given digit values

    This for large sized digits

    values : f, b

    access

    private

    Parameters

    Returns string

    string contains a digit layer

Private layerSixLarge

  • layerSixLarge(digit: Digit): string
  • layer six large

    returns layer six from a digit based on the given digit values

    This for large sized digits

    value : d, comma

    access

    private

    Parameters

    Returns string

    string contains a digit layer

Private layerThreeLarge

  • layerThreeLarge(digit: Digit): string
  • layer three large

    returns layer three from a digit based on the given digit values

    This for large sized digits

    value : g

    access

    private

    Parameters

    Returns string

    string contains a digit layer

Private layerTwo

  • layerTwo(digit: Digit): string
  • layer two

    returns layer two from a digit based on the given digit values

    This for normal sized digits

    values : e, d, c, comma

    access

    private

    Parameters

    Returns string

    string contains a digit layer

Private layerZero

  • layerZero(digit: Digit): string
  • layer zero

    returns layer zero from a digit based on the given digit values

    This for normal sized digits

    value : a

    access

    private

    Parameters

    Returns string

    string contains a digit layer

Private layerZeroLarge

  • layerZeroLarge(digit: Digit): string
  • layer zero large

    returns the zero layer from a digit based on the given digit values

    This for large sized digits

    value : a

    access

    private

    Parameters

    Returns string

    string contains a digit layer

printDigits

  • printDigits(digit: Digit[]): void
  • printDigits method

    this method prints the given digitsArray as a digit styled string in the console.

    This class uses the toString method from this class

    access

    public

    Parameters

    Returns void

printStringAsDigits

  • printStringAsDigits(string: string): void
  • printStringAsDigits

    this method prints the given string as a digit styled string in the console

    This class uses the toDigitString method

    access

    public

    Parameters

    • string: string

    Returns void

Private setDigitHeight

  • setDigitHeight(height: number): void
  • set digit height

    this method sets the digits height

    access

    private

    Parameters

    • height: number

    Returns void

setFramework

  • setFramework(framework: boolean): void
  • set Framework

    this method sets the value of the framework

    true = see framework false = hide framework

    access

    public

    Parameters

    • framework: boolean

    Returns void

setLargeDigits

  • setLargeDigits(largeDigits: boolean): void
  • set Large Digits

    this method sets the value of the large digits

    true = large digits false = normal digits

    access

    public

    Parameters

    • largeDigits: boolean

    Returns void

toDigitString

  • toDigitString(string: string): string
  • toDigitString

    This method returns the digit string from a given string.

    access

    public

    Parameters

    • string: string

    Returns string

    string contains digit styled numbers

toString

  • toString(digits: Digit[]): string
  • toString

    this Method returns the digit string from a given digitsArray

    access

    public

    Parameters

    Returns string

    string contains digit styled numbers

Private toStringLayer

  • toStringLayer(digit: Digit, layer: number): string
  • toStringLayer

    this method needs a digit and a layer number to return a string per digit per layer

    access

    private

    Parameters

    • digit: Digit
    • layer: number

    Returns string

    string contains a digit layer

Generated using TypeDoc