• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

Analitza

  • Analitza
  • Expression
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Analitza::Expression Class Reference
Analitza

#include <expression.h>

Public Types

typedef void(* CustomObjectDestructor )(const QVariant &)
 

Public Member Functions

 Expression ()
 
 Expression (const Expression &e)
 
 Expression (const Cn &e)
 
 Expression (Object *o)
 
 Expression (const QString &exp, bool mathml=false)
 
 ~Expression ()
 
void addError (const QString &error)
 
QStringList bvarList () const
 
void clear ()
 
QStringList comments () const
 
QVariant customObjectValue () const
 
Expression declarationValue () const
 
Expression elementAt (int position) const
 
Expression equationToFunction () const
 
QStringList error () const
 
bool isCorrect () const
 
bool isCustomObject () const
 
bool isDeclaration () const
 
bool isEquation () const
 
bool isLambda () const
 
bool isList () const
 
bool isReal () const
 
bool isString () const
 
bool isVector () const
 
Expression lambdaBody () const Q_REQUIRED_RESULT
 
QString name () const
 
bool operator!= (const Expression &e) const
 
Expression operator= (const Expression &e)
 
bool operator== (const Expression &e) const
 
QList< Ci * > parameters () const
 
void renameArgument (int depth, const QString &newName)
 
void setElementAt (int position, const Analitza::Expression &exp)
 
bool setMathML (const QString &exp)
 
bool setText (const QString &exp)
 
void setTree (Object *o)
 
QString stringValue () const
 
QList< Expression > toExpressionList () const
 
QString toHtml () const
 
QString toMathML () const
 
QString toMathMLPresentation () const
 
Cn toReal () const
 
QString toString () const
 
const Object * tree () const
 
Object * tree ()
 

Static Public Member Functions

static void computeDepth (Object *o)
 
static Expression constructCustomObject (const QVariant &custom, Analitza::Expression::CustomObjectDestructor d)
 
static Expression constructList (const QList< Expression > &exps)
 
static Expression constructString (const QString &str)
 
static bool isCompleteExpression (const QString &exp, bool justempty=false)
 
static bool isMathML (const QString &s)
 
static enum Object::ObjectType whatType (const QString &tag)
 

Detailed Description

Represents a mathematical expression.

Expression let to convert it to string, MathML and make some little queries to it, without calculating anything.

Definition at line 45 of file expression.h.

Member Typedef Documentation

typedef void(* Analitza::Expression::CustomObjectDestructor)(const QVariant &)

Definition at line 48 of file expression.h.

Constructor & Destructor Documentation

Analitza::Expression::Expression ( )

Constructs an empty Expression.

Analitza::Expression::Expression ( const Expression &  e)

Copy constructor, copies the whole object to the constructed one.

Analitza::Expression::Expression ( const Cn &  e)

Creates an expression from a value.

Analitza::Expression::Expression ( Object *  o)
explicit
Analitza::Expression::Expression ( const QString &  exp,
bool  mathml = false 
)
explicit

Constructor.

Parses an expression and creates the object.

Parameters
expexpression to be assigned
mathmlformat of the expression
Analitza::Expression::~Expression ( )

Destructor.

Member Function Documentation

void Analitza::Expression::addError ( const QString &  error)

Adds a new error error to the expression, to be reported afterwards.

QStringList Analitza::Expression::bvarList ( ) const
Returns
Lists the global bounded variables in the expression
void Analitza::Expression::clear ( )

Invalidates the data of the expression.

QStringList Analitza::Expression::comments ( ) const
static void Analitza::Expression::computeDepth ( Object *  o)
static
static Expression Analitza::Expression::constructCustomObject ( const QVariant &  custom,
Analitza::Expression::CustomObjectDestructor  d 
)
static

creates an expression filled with just a custom object

static Expression Analitza::Expression::constructList ( const QList< Expression > &  exps)
static
Returns
an expression containing a list of every expression passed on exps on the form: list { exps[0], exps[1], ... }
static Expression Analitza::Expression::constructString ( const QString &  str)
static

creates an expression filled with just a string

QVariant Analitza::Expression::customObjectValue ( ) const

In case it contains a custom object it returns its value.

Expression Analitza::Expression::declarationValue ( ) const
Returns
the value of the declaration. If it's not a declaration then an expression it's returned.
Expression Analitza::Expression::elementAt ( int  position) const

Returns the element at position in a vector.

Expression Analitza::Expression::equationToFunction ( ) const
Returns
the expression that evaluates the current equation to equal 0
QStringList Analitza::Expression::error ( ) const

Returns the list of errors that had experienced while building the expression.

static bool Analitza::Expression::isCompleteExpression ( const QString &  exp,
bool  justempty = false 
)
static
Returns
if a non-mathml expression is fully introduced (e.g. has closed all parentheses).
Parameters
justemptytells if it's an expression with just spaces and comments
bool Analitza::Expression::isCorrect ( ) const

Returns whether this is a correct expression.

bool Analitza::Expression::isCustomObject ( ) const
Returns
true if the expression is a custom object, false otherwise.
bool Analitza::Expression::isDeclaration ( ) const
Returns
whether it's a declaration
bool Analitza::Expression::isEquation ( ) const
Returns
whether it's an equation
bool Analitza::Expression::isLambda ( ) const

Returns whether it is a lambda-expression.

bool Analitza::Expression::isList ( ) const

Returns whether it is a list expression.

static bool Analitza::Expression::isMathML ( const QString &  s)
inlinestatic
Returns
whether s is MathML or not. Very simple.

Definition at line 241 of file expression.h.

bool Analitza::Expression::isReal ( ) const
Returns
true if the expression is a value, false otherwise.
bool Analitza::Expression::isString ( ) const

Returns whether it is a string expression (a list of chars).

bool Analitza::Expression::isVector ( ) const

Returns whether it is a vector expression.

Expression Analitza::Expression::lambdaBody ( ) const

Returns the expression of the lambda body (without resolving the dependencies)

QString Analitza::Expression::name ( ) const
Returns
the name of the expression. If it's not a declaration then an empty string it's returned.
bool Analitza::Expression::operator!= ( const Expression &  e) const
Expression Analitza::Expression::operator= ( const Expression &  e)

Copy assignment.

Copies the e expression here.

bool Analitza::Expression::operator== ( const Expression &  e) const

Returns whether the e is equal.

QList<Ci*> Analitza::Expression::parameters ( ) const
Returns
a list of the parameters in case this expression represents a lambda construction.
void Analitza::Expression::renameArgument ( int  depth,
const QString &  newName 
)

renames the depth -th variable into newName

void Analitza::Expression::setElementAt ( int  position,
const Analitza::Expression &  exp 
)

sets an expression value value to a position

bool Analitza::Expression::setMathML ( const QString &  exp)

Sets an expression exp which is in MathML format.

Returns whether it was correctly assigned or not.

bool Analitza::Expression::setText ( const QString &  exp)

Sets an expression exp which is not in MathML format.

Returns whether it was correctly assigned or not.

void Analitza::Expression::setTree ( Object *  o)
QString Analitza::Expression::stringValue ( ) const
Returns
the contained string value
QList<Expression> Analitza::Expression::toExpressionList ( ) const

In case it was a vector or list, it returns a list of each expression on the vector.

QString Analitza::Expression::toHtml ( ) const

Exports the expression to HTML.

QString Analitza::Expression::toMathML ( ) const

Converts the expression to MathML.

QString Analitza::Expression::toMathMLPresentation ( ) const

Converts the expression to MathML Presentation Markup.

Cn Analitza::Expression::toReal ( ) const
Returns
Value representation of the expression.
QString Analitza::Expression::toString ( ) const

Converts the expression to a string expression.

const Object* Analitza::Expression::tree ( ) const

Returns the tree associated to this object.

Object* Analitza::Expression::tree ( )

Returns the tree associated to this object.

static enum Object::ObjectType Analitza::Expression::whatType ( const QString &  tag)
static

Converts a tag to an object type.


The documentation for this class was generated from the following file:
  • expression.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:11:37 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Analitza

Skip menu "Analitza"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal