FTValueDictionaryClass Module

The FTValueDictionary subclass of FTDictionary adds convenient methods to easily add fundamental (Real, integer,…) values to a dictionary.

As a subclass, all other methods are still available.

Usage:

Adding a value

 CALL dict % addValueForKey(1,"integer")
 CALL dict % addValueForKey(3.14,"real")
 CALL dict % addValueForKey(98.6d0,"double")
 CALL dict % addValueForKey(.true.,"logical")
 CALL dict % addValueForKey("Hello World","string")

Accessing a value

 i = dict % integerValueForKey("integer")
 r = dict % realValueForKey("real")
 d = dict % doublePrecisionValueForKey("double")
 l = dict % logicalValueForKey("logical")
 s = dict % stringValueForKey("string",15)

Converting an FTDictionary to an FTValueDictionary

        valueDict => valueDictionaryFromDictionary(dict)

Converting an FTObject to an FTValueDictionary

        valueDict => valueDictionaryFromObject(obj)

Destruction

  call releaseFTValueDictionary(dict) [Pointers]

Uses

  • module~~ftvaluedictionaryclass~~UsesGraph module~ftvaluedictionaryclass FTValueDictionaryClass iso_fortran_env iso_fortran_env module~ftvaluedictionaryclass->iso_fortran_env module~ftdictionaryclass FTDictionaryClass module~ftvaluedictionaryclass->module~ftdictionaryclass module~ftvalueclass FTValueClass module~ftvaluedictionaryclass->module~ftvalueclass module~ftkeyobjectpairclass FTKeyObjectPairClass module~ftdictionaryclass->module~ftkeyobjectpairclass module~ftlinkedlistclass FTLinkedListClass module~ftdictionaryclass->module~ftlinkedlistclass module~ftlinkedlistiteratorclass FTLinkedListIteratorClass module~ftdictionaryclass->module~ftlinkedlistiteratorclass module~ftmutableobjectarrayclass FTMutableObjectArrayClass module~ftdictionaryclass->module~ftmutableobjectarrayclass module~hashmodule HashModule module~ftdictionaryclass->module~hashmodule module~ftvalueclass->iso_fortran_env ieee_arithmetic ieee_arithmetic module~ftvalueclass->ieee_arithmetic module~ftobjectclass FTObjectClass module~ftvalueclass->module~ftobjectclass module~ftolconstants FTOLConstants module~ftvalueclass->module~ftolconstants module~ftkeyobjectpairclass->module~ftobjectclass module~ftlinkedlistclass->module~ftmutableobjectarrayclass module~ftlinkedlistrecordclass FTLinkedListRecordClass module~ftlinkedlistclass->module~ftlinkedlistrecordclass module~ftlinkedlistiteratorclass->module~ftlinkedlistclass module~ftmutableobjectarrayclass->module~ftobjectclass module~ftlinkedlistrecordclass->module~ftobjectclass

Used by

  • module~~ftvaluedictionaryclass~~UsedByGraph module~ftvaluedictionaryclass FTValueDictionaryClass module~ftexceptionclass FTExceptionClass module~ftexceptionclass->module~ftvaluedictionaryclass module~ftobjectlibrary FTObjectLibrary module~ftobjectlibrary->module~ftvaluedictionaryclass module~ftobjectlibrary->module~ftexceptionclass module~sharedexceptionmanagermodule SharedExceptionManagerModule module~sharedexceptionmanagermodule->module~ftexceptionclass

Derived Types

type, public, extends(FTDictionary) ::  FTValueDictionary

Components

Type Visibility Attributes Name Initial
integer, public :: numberOfEntries
logical, public :: isCaseSensitive
type(FTLinkedList), public, DIMENSION(:), POINTER :: entries => NULL()

Type-Bound Procedures

procedure, public, non_overridable :: copy => copyFTObject
procedure, public, non_overridable :: retain => retainFTObject
procedure, public, non_overridable :: isUnreferenced
procedure, public, non_overridable :: refCount
procedure, public :: initWithSize
procedure, public :: init
procedure, public :: allKeys => AllKeys
procedure, public :: allObjects => AllObjects
procedure, public :: addObjectForKey
procedure, public :: description => FTDictionaryDescription
procedure, public :: printDescription => printFTDictionaryDescription
procedure, public :: objectForKey
procedure, public :: containsKey
procedure, public :: COUNT
generic, public :: addValueForKey => addRealValueForKey, addDoublePrecisionValueForKey, addIntegerValueForKey, addStringValueForKey, addLogicalValueForKey
generic, public :: addValueForKey => addQuadValueForKey
procedure, public :: realValueForKey
procedure, public :: doublePrecisionValueForKey
procedure, public :: quadValueForKey
procedure, public :: integerValueForKey
procedure, public :: stringValueForKey
procedure, public :: logicalValueForKey
procedure, public :: className => valueDictionaryClassName

Functions

public function realValueForKey(self, key)

Arguments

Type IntentOptional Attributes Name
class(FTValueDictionary) :: self
character(len=*) :: key

Return Value real

public function integerValueForKey(self, key)

Arguments

Type IntentOptional Attributes Name
class(FTValueDictionary) :: self
character(len=*) :: key

Return Value integer

public function doublePrecisionValueForKey(self, key)

Arguments

Type IntentOptional Attributes Name
class(FTValueDictionary) :: self
character(len=*) :: key

Return Value doubleprecision

public function quadValueForKey(self, key)

Arguments

Type IntentOptional Attributes Name
class(FTValueDictionary) :: self
character(len=*) :: key

Return Value real(kind=selected_real_kind(quad_digits))

public function logicalValueForKey(self, key)

Arguments

Type IntentOptional Attributes Name
class(FTValueDictionary) :: self
character(len=*) :: key

Return Value logical

public function stringValueForKey(self, key, requestedLength)

Arguments

Type IntentOptional Attributes Name
class(FTValueDictionary) :: self
character(len=*) :: key
integer :: requestedLength

Return Value character(len=requestedLength)

public function valueDictionaryFromDictionary(dict) result(valueDict)

Arguments

Type IntentOptional Attributes Name
class(FTDictionary), POINTER :: dict

Return Value class(FTValueDictionary), POINTER

public function valueDictionaryFromObject(obj) result(valueDict)

Arguments

Type IntentOptional Attributes Name
class(FTObject), POINTER :: obj

Return Value class(FTValueDictionary), POINTER

public function valueDictionaryClassName(self) result(s)

Class name returns a string with the name of the type of the object

Read more…

Arguments

Type IntentOptional Attributes Name
class(FTValueDictionary) :: self

Return Value character(len=CLASS_NAME_CHARACTER_LENGTH)


Subroutines

public subroutine releaseFTValueDictionary(self)

Public, generic name: release(self)

Read more…

Arguments

Type IntentOptional Attributes Name
type(FTValueDictionary), POINTER :: self

public subroutine addIntegerValueForKey(self, i, key)

Arguments

Type IntentOptional Attributes Name
class(FTValueDictionary) :: self
integer :: i
character(len=*) :: key

public subroutine addRealValueForKey(self, r, key)

Arguments

Type IntentOptional Attributes Name
class(FTValueDictionary) :: self
real :: r
character(len=*) :: key

public subroutine addDoublePrecisionValueForKey(self, r, key)

Arguments

Type IntentOptional Attributes Name
class(FTValueDictionary) :: self
double precision :: r
character(len=*) :: key

public subroutine addQuadValueForKey(self, r, key)

Arguments

Type IntentOptional Attributes Name
class(FTValueDictionary) :: self
real(kind=SELECTED_REAL_KIND(QUAD_DIGITS)) :: r
character(len=*) :: key

public subroutine addStringValueForKey(self, s, key)

Arguments

Type IntentOptional Attributes Name
class(FTValueDictionary) :: self
character(len=*) :: s
character(len=*) :: key

public subroutine addLogicalValueForKey(self, l, key)

Arguments

Type IntentOptional Attributes Name
class(FTValueDictionary) :: self
logical :: l
character(len=*) :: key

public subroutine castDictionaryToValueDictionary(dict, valueDict)

Arguments

Type IntentOptional Attributes Name
class(FTDictionary), POINTER :: dict
class(FTValueDictionary), POINTER :: valueDict

public subroutine castObjectToValueDictionary(obj, valueDict)

Arguments

Type IntentOptional Attributes Name
class(FTObject), POINTER :: obj
class(FTValueDictionary), POINTER :: valueDict