Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

MenuAnswer Class Reference

represents (multiple) answer(s) in a MenuSystem. More...

#include <MenuAnswer.h>

List of all members.

Public Methods

 MenuAnswer (const String &command)
 ~MenuAnswer ()
void operator= (const String &answer)
String get ()
String getExample ()
String getOriginalString ()
String getAssociatedCommand ()
bool ok () const
int getNoAnswers ()
void setCurrentAnswer (int i)
int getCurrentAnswer ()
bool multipleAnswers () const
const VecSimple(String)& answerStrings () const
void print (Os s_o) const


Detailed Description

represents (multiple) answer(s) in a MenuSystem.

NAME: MenuAnswer - represents (multiple) answer(s) in a MenuSystem

DESCRIPTION:

The class is used to expand an answer given in a compact form. This answer is supposed to describe a domain and to give the gridspacing for the computations. The answer (=value) can e.g. be on the form

   "value: d=2, [0,{1&3}]x[0,1], index: [1:{20&40}]x[1:{10:100,10}]"
This answer describes two domains in 2 dim, "[0,1]x[0,1]" and "[0,3]x[0,1]". The x-direction has 20 or 40 subdivisions, while the y-direction is divided from 10 to 100 parts in step by 10. The function "expand splits the answer and put the different parts in a list where each listitem is a new list:

        d=2, [0,
        |
        
        1 - 3
        |
        
        ]x[0,1], index: [1:
        |
        
        20 - 40
        |
        
        ]x[1:
        |
        
        10 - 20 - 30 - ..... - 100
        |
        
        ]
Afterwards, this list of lists is sorted and all different combinations are put in "ans_list".


Constructor & Destructor Documentation

MenuAnswer::MenuAnswer ( const String & command )
 

There is one constructor without arguments.

MenuAnswer::~MenuAnswer ( ) [inline]
 


Member Function Documentation

const VecSimple(String) & MenuAnswer::answerStrings ( ) const [inline]
 

returns the vector that contains the different strings.

String MenuAnswer::get ( ) [inline]
 

returns the string in position "current" in the vector "answer".

String MenuAnswer::getAssociatedCommand ( ) [inline]
 

returns the name of the command of the menu item that is associated with this answer object.

int MenuAnswer::getCurrentAnswer ( ) [inline]
 

returns "current".

String MenuAnswer::getExample ( ) [inline]
 

returns an example of an answer string. Used for checking valid syntax of input string.

int MenuAnswer::getNoAnswers ( ) [inline]
 

returns the number of strings that the input string given to "operator=" resulted in.

String MenuAnswer::getOriginalString ( ) [inline]
 

bool MenuAnswer::multipleAnswers ( ) const [inline]
 

bool MenuAnswer::ok ( ) const [inline]
 

void MenuAnswer::operator= ( const String & answer )
 

expands the string "answer" and converts the list of combinations to a vector of combinations.

void MenuAnswer::print ( Os s_o ) const
 

void MenuAnswer::setCurrentAnswer ( int i )
 

set "current" to a given int.


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.