sparseVectorNode Class Reference

#include <sparse-vector-node.hpp>

Inheritance diagram for sparseVectorNode:

Inheritance graph
[legend]
Collaboration diagram for sparseVectorNode:

Collaboration graph
[legend]
List of all members.

Detailed Description

This is a node within a linked list (sparseVector) which serves as a base class to other derived classes later on.

See also:
sparseVector
Todo:
move all inlines into the implementaiton code

Definition at line 36 of file sparse-vector-node.hpp.

Public Member Functions

 sparseVectorNode ()
 sparseVectorNode (int ix, sparseVectorNode *p)
sparseVectorNodegetNext ()
void setNext (sparseVectorNode *p)
int getIndex ()
void setIndex (int ix)
char * dumpAsXML ()
char * nodeSignature ()


Constructor & Destructor Documentation

sparseVectorNode::sparseVectorNode (  )  [inline]

Standard constructor with no parameters passed.

Definition at line 43 of file sparse-vector-node.hpp.

00043                           {
00044                 next=(sparseVectorNode *)0;
00045                 index=-1;
00046         };

sparseVectorNode::sparseVectorNode ( int  ix,
sparseVectorNode p 
) [inline]

Parametized constructor.

Parameters:
ix -- integer value to assign to the index value
p -- pointer to a sparseVectorNode to assign as "next."

Definition at line 55 of file sparse-vector-node.hpp.

00055                                                     {
00056                 next = p;
00057                 index = ix;
00058         };


Member Function Documentation

char * sparseVectorNode::dumpAsXML (  ) 

Dump the current node as XML. This will be overloaded by child classes

Returns:
(char*) well formed XML as one long string.

Reimplemented in orbitPlace.

Definition at line 31 of file sparse-vector-node.cpp.

References getIndex().

00031                                  {
00032         char * s;
00033         
00034         s=(char *) malloc(129); // 128 charactters plus trailing null.
00035         //~ s[0]='\0';
00036         
00037         int index = this->getIndex();
00038         sprintf(s,"<sparseVectorNode>\n\t<index>%d</index>\n<sparseVectorNode>\n",
00039                         index);
00040         return s;
00041 }

Here is the call graph for this function:

int sparseVectorNode::getIndex (  )  [inline]

Get the value of the index for this node.

Returns:
integer value representing the index value.

Definition at line 81 of file sparse-vector-node.hpp.

Referenced by sparseVector::addAt(), dumpAsXML(), sparseVector::findAt(), orbitPlace::getOrbit(), and star::getOrbit().

00081 { return index; };

Here is the caller graph for this function:

sparseVectorNode* sparseVectorNode::getNext (  )  [inline]

Retrieves the pointer to the next node in the list.

Returns:
pointer to sparseVectorNode representing the next node in the list.

Definition at line 66 of file sparse-vector-node.hpp.

Referenced by sparseVector::addAt(), sparseVector::dumpAsXML(), and sparseVector::findAt().

00066 { return next; };

Here is the caller graph for this function:

char * sparseVectorNode::nodeSignature (  ) 

Each node type has a signature no matter what underlying child class has overloaded this class. This method is meant to be overloaded and will be a string representation of what the class acutally is. This reminiscent of Java's Object.Class construction.

Returns:
(char*) string representation of what the actual class is.

Reimplemented in orbitPlace, and star.

Definition at line 43 of file sparse-vector-node.cpp.

00043                                      {
00044         return "sparseVectorNode";
00045 }

void sparseVectorNode::setIndex ( int  ix  )  [inline]

Set the index value for this node.

Parameters:
ix -- integer value for the new index value.

Definition at line 88 of file sparse-vector-node.hpp.

Referenced by orbitPlace::setOrbit(), and star::setOrbit().

00088 { index=ix; };

Here is the caller graph for this function:

void sparseVectorNode::setNext ( sparseVectorNode p  )  [inline]

Set the current node's pointer to the next node.

Parameters:
p -- pointer to a sparseVectorNode which is the next in the list.

Definition at line 74 of file sparse-vector-node.hpp.

Referenced by sparseVector::addAt().

00074 { next=p;};

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated on Fri Mar 7 16:43:13 2008 for frpuniverse by  doxygen 1.4.7