OOFEM 3.0
Loading...
Searching...
No Matches
oofem::Pair Class Reference

#include <pair.h>

Collaboration diagram for oofem::Pair:

Public Member Functions

 Pair (int k, double v)
 Constructor - creates the new Pair with given key k and value v.
 ~Pair ()
 Destructor.
void append (Pair *p)
 Appends a given pair to itself (sets the pointer to next pair to given Pair).
int giveKey ()
 Returns the receiver key.
Pair * giveNext ()
 Returns pointer to the next pair.
double & giveValue ()
 Returns associated value.
void printYourself ()
 Prints receiver to screen.

Private Attributes

int key
 Key.
double value
 Associate value.
Pair * next
 Pointer to the next Pair.

Detailed Description

This class implements key/value associations - the key and its associated value. An instance of Pair is used as an entry in a dictionary. Pair has three components - its key, its value and pointer to the next Pair in the dictionary.

Tasks:

  • Returning its key, or its value, or the next pair ;
  • Appending another pair to itself.

Definition at line 51 of file pair.h.

Constructor & Destructor Documentation

◆ Pair()

oofem::Pair::Pair ( int k,
double v )
inline

Constructor - creates the new Pair with given key k and value v.

Definition at line 63 of file pair.h.

References key, next, and value.

Referenced by append(), and giveNext().

◆ ~Pair()

oofem::Pair::~Pair ( )
inline

Destructor.

Definition at line 65 of file pair.h.

Member Function Documentation

◆ append()

void oofem::Pair::append ( Pair * p)
inline

Appends a given pair to itself (sets the pointer to next pair to given Pair).

Definition at line 68 of file pair.h.

References next, and Pair().

◆ giveKey()

◆ giveNext()

◆ giveValue()

double & oofem::Pair::giveValue ( )
inline

◆ printYourself()

void oofem::Pair::printYourself ( )
inline

Prints receiver to screen.

Definition at line 76 of file pair.h.

References key, and value.

Referenced by oofem::Dictionary::printYourself().

Member Data Documentation

◆ key

int oofem::Pair::key
private

Key.

Definition at line 55 of file pair.h.

Referenced by giveKey(), Pair(), and printYourself().

◆ next

Pair* oofem::Pair::next
private

Pointer to the next Pair.

Definition at line 59 of file pair.h.

Referenced by append(), giveNext(), and Pair().

◆ value

double oofem::Pair::value
private

Associate value.

Definition at line 57 of file pair.h.

Referenced by giveValue(), Pair(), and printYourself().


The documentation for this class was generated from the following file:

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011