uk.ac.ebi.adfconverter.common.data.tabulardata
Class DataTableHeader

java.lang.Object
  extended byuk.ac.ebi.adfconverter.common.data.tabulardata.DataTableHeader
Direct Known Subclasses:
CorrectableDataTableHeader

public class DataTableHeader
extends java.lang.Object

This Class represents the list of data table headers

Version:
1
Author:
Pierre MARGUERITE
See Also:
HeaderItemPool, TODO improve data structure - hashtable? ADF MAGE-TOOL - MicroArray Informatics Team / European Bioinformatics Institute (EBI) ArrayExpress License: ============================================================================== Copyright (c) 2002 The European Bioinformatics Institute. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name ArrayExpress must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact arrayexpress@ebi.ac.uk 4. Products derived from this software may not be called "ArrayExpress" nor may "ArrayExpress" appear in their names without prior written permission of the ArrayExpress developers. 5. Redistributions of any form whatsoever must retain the following acknowledgment: "This product includes software developed by ArrayExpress (http://www.ebi.ac.uk/arrayexpress)" THIS SOFTWARE IS PROVIDED BY THE ARRAYEXPRESS GROUP ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARRAYEXPRESS GROUP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The European Bioinformatics Institute may publish revised and/or new versions of this license with new releases of ArrayExpress software. ==============================================================================

Constructor Summary
DataTableHeader()
          Constructor of the headerItem class
DataTableHeader(int capacity)
          Constructor of the headerItem class with an initial capacity for the header list
 
Method Summary
 void addItem(HeaderItem item)
          Adds an item to the header list for convenience
 void addItem(HeaderItem item, int index)
          Adds an item to the header list
 void clear()
          cleans memory used when the header is not needed anymore
 boolean contains(HeaderItem item)
          retrieves an item is already in this header
 HeaderItem getItem(int index)
          retrieve an item from the header list at a given position
 HeaderItem getItem(java.lang.String itemName)
          retrieve an item from the header list by a given name
 int getItemColumn(HeaderItem item)
          retrieve the position of an item
 int getItemColumnByLabel(java.lang.String label)
          retrieve the position of an item by its label
 java.util.Iterator getItems()
          Retrieves the list of items contained in the header .
 int getLineNumber()
          Retrieves the line number of the header in the data file.
 void InitNextItem()
          initialised the parsing of item list Starts at the begin of the list
 HeaderItem nextItem()
          Retrieves the next item in the list
 void removeItem(HeaderItem item)
          Removes an given item from the header list
 void removeItem(int index)
          Removes an item at a given position from the header list
 void setLineNumber(int lineNumber)
          Sets the line number of the header in the data file
 int size()
          Retrieves the header items number
 java.lang.String toString()
          For debugging purpose.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataTableHeader

public DataTableHeader()
Constructor of the headerItem class


DataTableHeader

public DataTableHeader(int capacity)
Constructor of the headerItem class with an initial capacity for the header list

Parameters:
capacity - the initial capacity of the list
Method Detail

addItem

public void addItem(HeaderItem item)
Adds an item to the header list for convenience

Parameters:
item - the new item to add

addItem

public void addItem(HeaderItem item,
                    int index)
Adds an item to the header list

Parameters:
item - the new item to add
index - the position of the item the header file

clear

public void clear()
cleans memory used when the header is not needed anymore


contains

public boolean contains(HeaderItem item)
retrieves an item is already in this header

Parameters:
item - the item wanted to be test
Returns:
true, if the header contains the item. False, otherwise

getItem

public HeaderItem getItem(int index)
retrieve an item from the header list at a given position

Parameters:
index - the position of the item to remove
Returns:
the HeaderItem at the given position

getItem

public HeaderItem getItem(java.lang.String itemName)
retrieve an item from the header list by a given name

Parameters:
itemName - the name of the search file
Returns:
the HeaderItem with the given name. null otherwise

getItemColumn

public int getItemColumn(HeaderItem item)
retrieve the position of an item

Parameters:
item - the item to find
Returns:
the position of the specified item

getItemColumnByLabel

public int getItemColumnByLabel(java.lang.String label)
retrieve the position of an item by its label

Parameters:
label - the item label to find
Returns:
the column number with the given label

getItems

public java.util.Iterator getItems()
Retrieves the list of items contained in the header .

Returns:
header iterator Iterator can be used by boolean hasNext() method object next() method

getLineNumber

public int getLineNumber()
Retrieves the line number of the header in the data file.

Returns:
line number of the header in the file. -1, if the header is not associated to a file

InitNextItem

public void InitNextItem()
initialised the parsing of item list Starts at the begin of the list


nextItem

public HeaderItem nextItem()
Retrieves the next item in the list

Returns:
the next item

removeItem

public void removeItem(HeaderItem item)
Removes an given item from the header list

Parameters:
item - the new item to add

removeItem

public void removeItem(int index)
Removes an item at a given position from the header list

Parameters:
index - the item positiom

setLineNumber

public void setLineNumber(int lineNumber)
Sets the line number of the header in the data file

Parameters:
lineNumber - the line number of the header in the data file

size

public int size()
Retrieves the header items number

Returns:
the size of the header list

toString

public java.lang.String toString()
For debugging purpose. Converts the row of data into String

Returns:
String representation of data row.


European Bioinformatics InstituteMicroarray Informatics Team