Reference Class Reference

#include <refs.h>

Inheritance diagram for Reference:

Value List of all members.

Public Member Functions

 Reference (int C, int R, bool AC, bool AR)
 Reference (Token compound)
virtual QString toString ()
virtual Data getSaveDescription (QString)
virtual bool equals_same_type (Value *other)

Public Attributes

int column
int row
bool absolute_col
bool absolute_row

Detailed Description

Definition at line 5 of file refs.h.


Constructor & Destructor Documentation

Reference::Reference int  C,
int  R,
bool  AC,
bool  AR
 

Definition at line 3 of file refs.cpp.

References absolute_col, absolute_row, column, and row.

00004 {
00005   column = C;
00006   row = R;
00007   absolute_col = AC;
00008   absolute_row = AR;
00009 }

Reference::Reference Token  compound  ) 
 

Definition at line 11 of file refs.cpp.

References absolute_col, absolute_row, column, and row.

00012 {
00013   column = (Unsigned1)compound["column"];
00014   row = (Unsigned1)compound["row"];
00015   absolute_col = (Unsigned1)compound["absolute_col"];
00016   absolute_row = (Unsigned1)compound["absolute_row"];
00017 }


Member Function Documentation

bool Reference::equals_same_type Value other  )  [virtual]
 

Implements Value.

Definition at line 44 of file refs.cpp.

References absolute_col, absolute_row, column, and row.

Referenced by Range::equals_same_type().

00045 {
00046   return ((Reference*)other)->column == column &&
00047     ((Reference*)other)->row == row &&
00048     ((Reference*)other)->absolute_col == absolute_col &&
00049     ((Reference*)other)->absolute_row == absolute_row;
00050 };

Data Reference::getSaveDescription QString   )  [virtual]
 

Implements Value.

Definition at line 19 of file refs.cpp.

References absolute_col, absolute_row, column, and row.

Referenced by Range::getSaveDescription(), and SpreadSheetTable::saveFile().

00020 {
00021   Token compound;
00022   compound["type"]=Symbol("reference");
00023   compound["column"]=Unsigned1(column);
00024   compound["row"]=Unsigned1(row);
00025   compound["absolute_col"]=Unsigned1(absolute_col);
00026   compound["absolute_row"]=Unsigned1(absolute_row);
00027   return compound;
00028 };

QString Reference::toString  )  [virtual]
 

Implements Value.

Definition at line 30 of file refs.cpp.

References absolute_col, absolute_row, column, and row.

Referenced by Range::toString().

00031 {
00032   QString text = "";
00033   if (absolute_col) text+="$";
00034   assert(column<26);
00035   char ch[2];
00036   ch[1]=0;
00037   ch[0]='A'+column;
00038   text+=QString(ch);
00039   if (absolute_row) text+="$";
00040   text+=QString::number(row);
00041   return text; 
00042 }


Member Data Documentation

bool Reference::absolute_col
 

Definition at line 10 of file refs.h.

Referenced by RelativeShifter::copyRef(), equals_same_type(), getSaveDescription(), Reference(), and toString().

bool Reference::absolute_row
 

Definition at line 11 of file refs.h.

Referenced by RelativeShifter::copyRef(), equals_same_type(), getSaveDescription(), Reference(), and toString().

int Reference::column
 

Definition at line 8 of file refs.h.

Referenced by RelativeShifter::copyRef(), CellRightShifter::copyRef(), equals_same_type(), IisCell::gather_inputs(), getSaveDescription(), SpreadSheetTable::loadFile(), IisCell::lookup(), Reference(), and toString().

int Reference::row
 

Definition at line 9 of file refs.h.

Referenced by RelativeShifter::copyRef(), CellDownShifter::copyRef(), equals_same_type(), IisCell::gather_inputs(), getSaveDescription(), SpreadSheetTable::loadFile(), IisCell::lookup(), Reference(), and toString().


The documentation for this class was generated from the following files:
Generated on Mon Jun 5 22:08:43 2006 for iis by  doxygen 1.4.6