gov.nih.nlm.util
Class FileStatistics

java.lang.Object
  extended bygov.nih.nlm.util.FileStatistics

public class FileStatistics
extends Object

Container for info about file statistics.


Constructor Summary
FileStatistics()
          Instantiates an empty FileStatistics
 
Method Summary
 void clear()
          Clear all statistics.
 ColumnStatistics[] getAllColumnStatistics()
          Returns the ColumnStatistics for the file.
 long getByteCount()
          Returns the byte count.
 boolean getCharsEqualsBytes()
          Indicates if the character encoding is one byte per character or not.
 ColumnStatistics getColumnStatistics(String column)
          Returns the statistics for a particular column of the file.
 String getDescription()
          Returns a description of the file.
 String getFileName()
          Returns the file name.
 int getLineCount()
          Returns the line count.
 void incrementByteCount(int increment)
          Increments the byte count by a certain amount.
 void incrementLineCount()
          Increments the line count by 1.
 String processLine(String line)
          Compute statistics for the line of the file.
 void setAllColumnStatistics(ColumnStatistics[] newColumns)
          Sets all of the ColumnStatistics.
 void setByteCount(long newbyte_count)
          Sets the byte count.
 void setCharsEqualsBytes(boolean chars_equals_bytes)
          Sets a flag which indicates if the character encoding is one byte per character or not.
 void setDescription(String newDescription)
          Sets the file description
 void setFileName(String newfile_name)
          Sets the file name.
 void setLineCount(int newline_count)
          Sets the line count.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileStatistics

public FileStatistics()
Instantiates an empty FileStatistics

Method Detail

getByteCount

public long getByteCount()
Returns the byte count.

Returns:
the byte count

getAllColumnStatistics

public ColumnStatistics[] getAllColumnStatistics()
Returns the ColumnStatistics for the file.

Returns:
the ColumnStatistics for the file

getColumnStatistics

public ColumnStatistics getColumnStatistics(String column)
Returns the statistics for a particular column of the file.

Parameters:
column - the specified column name
Returns:
the ColumnStatistics for the column name

getFileName

public String getFileName()
Returns the file name.

Returns:
the file name

getLineCount

public int getLineCount()
Returns the line count.

Returns:
the line count

setByteCount

public void setByteCount(long newbyte_count)
Sets the byte count.

Parameters:
newbyte_count - the byte count

setAllColumnStatistics

public void setAllColumnStatistics(ColumnStatistics[] newColumns)
Sets all of the ColumnStatistics.

Parameters:
newColumns - the specified ColumnStatistics.

setFileName

public void setFileName(String newfile_name)
Sets the file name.

Parameters:
newfile_name - the file name

setLineCount

public void setLineCount(int newline_count)
Sets the line count.

Parameters:
newline_count - the line ocunt

incrementLineCount

public void incrementLineCount()
Increments the line count by 1.


incrementByteCount

public void incrementByteCount(int increment)
Increments the byte count by a certain amount.

Parameters:
increment - the amount to increment by

clear

public void clear()
Clear all statistics.


getDescription

public String getDescription()
Returns a description of the file.

Returns:
a description of the files

setCharsEqualsBytes

public void setCharsEqualsBytes(boolean chars_equals_bytes)
Sets a flag which indicates if the character encoding is one byte per character or not.

Parameters:
chars_equals_bytes - boolean

getCharsEqualsBytes

public boolean getCharsEqualsBytes()
Indicates if the character encoding is one byte per character or not.

Returns:
chars_equals_bytes boolean

setDescription

public void setDescription(String newDescription)
Sets the file description

Parameters:
newDescription - the file description

processLine

public String processLine(String line)
Compute statistics for the line of the file. This includes computing the underlying column stats.

Parameters:
line - a line of the file
Returns:
the input line (unchanged)


Copyright ©2005