The Dendrogrammer Code Documentation

dendrogrammer  Dendrogrammer version 1.0.3

The Dendrogrammer > dendrogrammer > ClusterTable

Class ClusterTable

Reads the data (held in the page as hidden elements of an HTML form) into a table. The 'table' is actually three tables: an array of clusterRows, an array of datRows, and an array of nodeRows.

The constructor calls the getData() method to fill the arrays. It also calls assignIdNos() method.

ClusterTree is generated from the ClusterTable and once this has been done the job of the ClusterTable is complete and it is not referred to again.

Constructor

ClusterTable ( )

Methods

assignIdNos

void assignIdNos ( )
Loops through the rows assigning an ID to the clusters the first is lastLeaf number +1 the next is lastLeaf+2 and so on
Returns: void

getCurrentRow

clusterRow object getCurrentRow ( )
Returns the row indexed by the current pointer value
Returns: clusterRow object

getData

string getData ( )
Fills the table with data.
Gathers data from the hidden form elements and insert in the table
1) Creates an associative array of all the input elements in the page
2) Dat file data: loop through the array picking out the fields for each Dat row (manifest file)
3) Node file data: as above but for the main cluster data
4) Leaf file data: as above but for the leaf data

Encompasses object constructor functions for clusterRow, datRow and leafRow objects.
Returns: string
the filename of the originating Dat file.

getDescription

string getDescription ( )
Returns the data description text which is the 3rd row in the dat table
Returns: string
the 3rd item in the dat table

getHtByIdNo

number getHtByIdNo ( idNoIn )
Loops through the rows for the given IdNo and returns the mergeHt for that row with that given IdNo
Parameters:
idNoIn <integer>
Returns: number
the itemB for that row

getItemAByIdNo

number getItemAByIdNo ( idNoIn )
Loops through the rows for the given IdNo and returns the itemA for that row
Parameters:
idNoIn <integer>
Returns: number
the itemA for that row

getItemBByIdNo

number getItemBByIdNo ( idNoIn )
Loops through the rows for the given IdNo and returns the itemB for that row
Parameters:
idNoIn <integer>
Returns: number
the itemB for that row

getLast

clusterRow object getLast ( )
Returns the last row in the table
Returns: clusterRow object

getNextRow

clusterRow object getNextRow ( )
Increments the pointer then returns the newly pointed to row. Should only be called after checking with .nextRowExists
Returns: clusterRow object

getNoOfLeaves

number getNoOfLeaves ( idNoIn )
Returns the number of rows in the cArray table
Parameters:
idNoIn <integer>
Returns: number
the itemB for that row

getPtr

integer getPtr ( )
Returns the current pointer value
Returns: integer

getRowByIndex

clusterRow object getRowByIndex ( indexIn )
Returns a row from the cArray by index
Parameters:
indexIn <number>
Returns: clusterRow object

getRowIndexByIdNo

integer getRowIndexByIdNo ( idNoIn )
Loops through the rows for the given IdNo and returns the array index for that row
Parameters:
idNoIn <integer>
Returns: integer
the array index for that row

getSearchLink

string getSearchLink ( )
Returns the search link text which is the 4th row in the dat table
Returns: string
the 4th item in the dat table

isLeafByIdNo

boolean isLeafByIdNo ( idNoIn )
Detects whether a cluster IdNo represents a leaf. It will be a leaf if the idNo <= the number of leaves
Parameters:
idNoIn <integer>
Returns: boolean

nextRowExists

boolean nextRowExists ( )
Detects whether or not there is another row beyond that pointed to by the pointer
Returns: boolean


The Dendrogrammer © 2011 D.Robb (See Readme for MIT licence). These pages were created with YUIDoc Copyright © 2011 Yahoo! Inc. All rights reserved.