OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::Pair Class Reference

This class implements key/value associations - the key and its associated value. More...

#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. More...
 
 ~Pair ()
 Destructor. More...
 
void append (Pair *p)
 Appends a given pair to itself (sets the pointer to next pair to given Pair). More...
 
int giveKey ()
 Returns the receiver key. More...
 
PairgiveNext ()
 Returns pointer to the next pair. More...
 
double & giveValue ()
 Returns associated value. More...
 
void printYourself ()
 Prints receiver to screen. More...
 

Private Attributes

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

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

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.

oofem::Pair::~Pair ( )
inline

Destructor.

Definition at line 65 of file pair.h.

Member Function Documentation

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.

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

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

Returns associated value.

Definition at line 74 of file pair.h.

Referenced by oofem::Dictionary::at(), oofem::Dictionary::formatAsString(), oofem::operator<<(), and oofem::Dictionary::saveContext().

void oofem::Pair::printYourself ( )
inline

Prints receiver to screen.

Definition at line 76 of file pair.h.

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

Member Data Documentation

int oofem::Pair::key
private

Key.

Definition at line 55 of file pair.h.

Pair* oofem::Pair::next
private

Pointer to the next Pair.

Definition at line 59 of file pair.h.

double oofem::Pair::value
private

Associate value.

Definition at line 57 of file pair.h.


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

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:39 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011