Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Member Functions | Private Attributes
txResultNumberComparator Class Reference

#include <txXPathResultComparator.h>

Inheritance diagram for txResultNumberComparator:
Inheritance graph
Collaboration diagram for txResultNumberComparator:
Collaboration graph

List of all members.


class  NumberValue

Public Member Functions

 txResultNumberComparator (MBool aAscending)
virtual ~txResultNumberComparator ()
int compareValues (TxObject *aVal1, TxObject *aVal2)
TxObjectcreateSortableValue (txAExprResult *aExprRes)

Private Attributes

int mAscending

Detailed Description

Definition at line 116 of file txXPathResultComparator.h.

Class Documentation

class txResultNumberComparator::NumberValue

Definition at line 128 of file txXPathResultComparator.h.

Class Members
double mVal

Constructor & Destructor Documentation

Definition at line 258 of file txXPathResultComparator.cpp.

    mAscending = aAscending ? 1 : -1;

Definition at line 263 of file txXPathResultComparator.cpp.


Member Function Documentation

int txResultNumberComparator::compareValues ( TxObject aVal1,
TxObject aVal2 
) [virtual]

Implements txXPathResultComparator.

Definition at line 275 of file txXPathResultComparator.cpp.

    double dval1 = ((NumberValue*)aVal1)->mVal;
    double dval2 = ((NumberValue*)aVal2)->mVal;

    if (Double::isNaN(dval1))
        return Double::isNaN(dval2) ? 0 : -mAscending;

    if (Double::isNaN(dval2))
        return mAscending;

    if (dval1 == dval2)
        return 0;
    return (dval1 < dval2) ? -mAscending : mAscending;

Here is the call graph for this function:

Implements txXPathResultComparator.

Definition at line 267 of file txXPathResultComparator.cpp.

    NumberValue* numval = new NumberValue;
    if (numval)
        numval->mVal = aExprRes->numberValue();
    return numval;

Here is the call graph for this function:

Member Data Documentation

Definition at line 126 of file txXPathResultComparator.h.

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