FTStringSet is a class for an unordered collection of strings. Use a FTStringSet
to store strings as an alternative to arrays when the order is not important, but
testing for membership is.
Definition
TYPE ( FTStringSet ) :: varName
Usage
Initialization
CLASS(FTStringSet) :: FTStringSet
integer :: N = 11
logical :: cs = .true.
CALL FTStringSet % initFTStringSet(N,cs)
CLASS(FTStringSet) :: FTStringSet
CHARACTER(LEN=*) :: strings(:)
CALL FTStringSet % initWithStrings(strings)
Destruction
CALL FTStringSet % destuct () [ Non Pointers ]
CALL releaseFTStringSet ( stringSet ) [ Pointers ]
Adding Strings
CALL set % addString(str)
Testing membership:
if ( set % containsString ( str )) THEN
Getting an array of members
CHARACTER(LEN=FTDICT_KWD_STRING_LENGTH) ,DIMENSION(:), POINTER :: s
s => set % strings
... do something ...
DEALLOCATE(s)
Set operations, union, intersection, difference
newSet => set1 % unionWithSet ( set2 )
... do something ...
call releaseFTStringSet ( newSet )
newSet => set1 % intersectionWithSet ( set2 )
... do something ...
call releaseFTStringSet ( newSet )
newSet => set1 % setFromDifference ( set2 )
... do something ...
call releaseFTStringSet ( newSet )
module~~ftstringsetclass~~UsesGraph
module~ftstringsetclass
FTStringSetClass
module~ftdictionaryclass
FTDictionaryClass
module~ftstringsetclass->module~ftdictionaryclass
module~ftobjectclass
FTObjectClass
module~ftstringsetclass->module~ftobjectclass
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~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
Nodes of different colours represent the following:
Graph Key
Module
Module
Submodule
Submodule
Subroutine
Subroutine
Function
Function
Program
Program
This Page's Entity
This Page's Entity
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
Derived Types
Finalizations Procedures
final :: destructFTStringSet
Type-Bound Procedures
procedure, public ::
init => initFTObject
procedure, public ::
description => FTObjectDescription
procedure, public, non_overridable ::
copy => copyFTObject
procedure, public, non_overridable ::
retain => retainFTObject
procedure, public, non_overridable ::
isUnreferenced
procedure, public, non_overridable ::
refCount
procedure, public ::
initFTStringSet
procedure, public ::
initWithStrings
procedure, public ::
addString => AddString
procedure, public ::
containsString
procedure, public ::
strings
procedure, public ::
unionWithSet
procedure, public ::
intersectionWithSet
procedure, public ::
setFromDifference
procedure, public ::
isEmpty
procedure, public ::
count => stringCount
procedure, public ::
printDescription => printFTStringSet
procedure, public ::
className => FTStringSetClassName
Functions
Arguments
Type
Intent Optional Attributes
Name
class(FTStringSet )
::
self
Return Value
integer
containsString returns .TRUE. if the set contains the string, .FALSE.
otherwise.
Read more…
Arguments
Type
Intent Optional Attributes
Name
class(FTStringSet )
::
self
character(len=*)
::
str
Return Value
logical
strings returns a pointer to an array of strings that are in the set.
Deallocate this array when done with it.
Read more…
Arguments
Type
Intent Optional Attributes
Name
class(FTStringSet )
::
self
Return Value
character(len=FTDICT_KWD_STRING_LENGTH), DIMENSION(:), POINTER
unionWithSet returns a pointer to a new set that is the union of two sets.
the new set has reference count of 1. Release when done.
Read more…
Arguments
Return Value
type(FTStringSet ), POINTER
intersectionWithSet returns a pointer to a new set that is the intersection of two sets.
the new set has reference count of 1. Release when done.
Read more…
Arguments
Return Value
type(FTStringSet ), POINTER
setFromDifference returns a pointer to a new set that is the difference of two sets.
the new set has reference count of 1. Release when done.
Read more…
Arguments
Return Value
type(FTStringSet ), POINTER
Arguments
Type
Intent Optional Attributes
Name
class(FTStringSet )
::
self
Return Value
logical
Generic Name: cast
Read more…
Arguments
Type
Intent Optional Attributes
Name
class(FTObject ),
POINTER
::
obj
Return Value
class(FTStringSet ), POINTER
Class name returns a string with the name of the type of the object
Read more…
Arguments
Type
Intent Optional Attributes
Name
class(FTStringSet )
::
self
Return Value
character(len=CLASS_NAME_CHARACTER_LENGTH)
Subroutines
Designated initializer. Initializes the amount of storage, but
the FTStringSet remains empty.
Read more…
Arguments
Type
Intent Optional Attributes
Name
class(FTStringSet )
::
self
integer
::
FTStringSetSize
initializer. Initializes the amount of storage from the strings passed
Usage
CLASS(FTStringSet) :: FTStringSet
CHARACTER(LEN= ) :: strings(:)
CALL FTStringSet % initWithStrings(strings)
Arguments
Type
Intent Optional Attributes
Name
class(FTStringSet )
::
self
character(len=*)
::
strings (:)
Destructor for the class. This is called automatically when the
reference count reaches zero. Do not call this yourself on pointers
Arguments
Type
Intent Optional Attributes
Name
type(FTStringSet )
::
self
Public, generic name: release(self)
Read more…
Arguments
Type
Intent Optional Attributes
Name
type(FTStringSet ),
POINTER
::
self
AddString adds a string to the set if it is not already present
Read more…
Arguments
Type
Intent Optional Attributes
Name
class(FTStringSet )
::
self
character(len=*)
::
str
Arguments
Type
Intent Optional Attributes
Name
class(FTStringSet )
::
self
integer
::
iUnit