org.knime.base.node.io.filereader
Class FileAnalyzer.HeaderHelper

java.lang.Object
  extended by org.knime.base.node.io.filereader.FileAnalyzer.HeaderHelper
Enclosing class:
FileAnalyzer

static final class FileAnalyzer.HeaderHelper
extends Object

Little helper class for the check header method. Holds the prefix and the running index of possible row or column headers.

Author:
ohl, University of Konstanz

Method Summary
(package private) static FileAnalyzer.HeaderHelper extractPrefixAndIndexFromHeader(String header)
          from the header passed it extracts the prefix and the running index and stores them in the returned helper class.
(package private)  boolean testNextHeader(String headerToTest)
          Checks if the specified header fits in the sequence of consecutive headers.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

testNextHeader

boolean testNextHeader(String headerToTest)
Checks if the specified header fits in the sequence of consecutive headers. That is, it must consist of the stored prefix followed by a number (the running index) that must be larger than the last one seen. It is assumed that all headers are checked through this method in the order they are read (because this method stores the last running index seen).
If false is returned, this method doesn't change its last running index seen.

Parameters:
headerToTest - the next header in the file to test.
Returns:
true, if this header fits in the sequence of header - with its prefix and its running index.

extractPrefixAndIndexFromHeader

static FileAnalyzer.HeaderHelper extractPrefixAndIndexFromHeader(String header)
from the header passed it extracts the prefix and the running index and stores them in the returned helper class. If the specified header has no index at the end, it returns null.

Parameters:
header - the (possible) header to examine
Returns:
a class holding the (possibly empty) prefix and the running index of the specified header, or null, if the header has no prefix

toString

public String toString()

Overrides:
toString in class Object


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.