org.apache.mahout.math.matrix.impl
Class AbstractFormatter

java.lang.Object
  extended by org.apache.mahout.math.PersistentObject
      extended by org.apache.mahout.math.matrix.impl.AbstractFormatter
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
Formatter

Deprecated. until unit tests are in place. Until this time, this class/interface is unsupported.

@Deprecated
public abstract class AbstractFormatter
extends PersistentObject

See Also:
Serialized Form

Field Summary
protected  java.lang.String alignment
          Deprecated. The default format string for formatting a single cell value; currently "%G".
static java.lang.String CENTER
          Deprecated. The alignment string aligning the cells of a column to its center.
static java.lang.String DECIMAL
          Deprecated. The alignment string aligning the cells of a column to the decimal point.
protected  java.lang.String format
          Deprecated. The default format string for formatting a single cell value; currently "%G".
static java.lang.String LEFT
          Deprecated. The alignment string aligning the cells of a column to the left.
protected  boolean printShape
          Deprecated. Tells whether String representations are to be preceded with summary of the shape; currently true.
static java.lang.String RIGHT
          Deprecated. The alignment string aligning the cells of a column to the right.
protected  java.lang.String rowSeparator
          Deprecated. The default string separating any two rows from another; currently "\n".
protected  java.lang.String sliceSeparator
          Deprecated. The default string separating any two slices from another; currently "\n\n".
 
Constructor Summary
protected AbstractFormatter()
          Deprecated. Makes this class non instantiable, but still let's others inherit from it.
 
Method Summary
protected  void align(java.lang.String[][] strings)
          Deprecated. Modifies the strings in a column of the string matrix to be aligned (left,centered,right,decimal).
protected static int alignmentCode(java.lang.String alignment)
          Deprecated. Converts a row into a string.
protected  void alignRow(java.lang.String[] row, int[] maxColWidth, int[] maxColLead)
          Deprecated. Modifies the strings the string matrix to be aligned (left,centered,right,decimal).
protected static java.lang.String blanks(int length)
          Deprecated. Returns a String with length blanks.
protected abstract  java.lang.String form(AbstractMatrix1D matrix, int index, Former formatter)
          Deprecated. Converts a given cell to a String; no alignment considered.
protected abstract  java.lang.String[][] format(AbstractMatrix2D matrix)
          Deprecated. Returns a string representations of all cells; no alignment considered.
protected  java.lang.String[] formatRow(AbstractMatrix1D vector)
          Deprecated. Returns a string representations of all cells; no alignment considered.
protected  int lead(java.lang.String s)
          Deprecated. Returns the number of characters or the number of characters before the decimal point.
protected  java.lang.String repeat(char character, int length)
          Deprecated. Returns a String with the given character repeated length times.
 void setAlignment(java.lang.String alignment)
          Deprecated. Sets the column alignment (left,center,right,decimal).
 void setColumnSeparator(java.lang.String columnSeparator)
          Deprecated. Sets the string separating any two columns from another.
 void setFormat(java.lang.String format)
          Deprecated. Sets the way a single cell value is to be formatted.
 void setMinColumnWidth(int minColumnWidth)
          Deprecated. Sets the minimum number of characters a column may have.
 void setPrintShape(boolean printShape)
          Deprecated. Specifies whether a string representation of a matrix is to be preceded with a summary of its shape.
 void setRowSeparator(java.lang.String rowSeparator)
          Deprecated. Sets the string separating any two rows from another.
 void setSliceSeparator(java.lang.String sliceSeparator)
          Deprecated. Sets the string separating any two slices from another.
static java.lang.String shape(AbstractMatrix matrix)
          Deprecated. Returns a short string representation describing the shape of the matrix.
static java.lang.String shape(AbstractMatrix2D matrix)
          Deprecated. Returns a short string representation describing the shape of the matrix.
static java.lang.String shape(AbstractMatrix3D matrix)
          Deprecated. Returns a short string representation describing the shape of the matrix.
protected  java.lang.String toString(AbstractMatrix2D matrix)
          Deprecated. Returns a string representation of the given matrix.
protected  java.lang.String toString(java.lang.String[][] strings)
          Deprecated. Returns a single string representation of the given string matrix.
 
Methods inherited from class org.apache.mahout.math.PersistentObject
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT

public static final java.lang.String LEFT
Deprecated. 
The alignment string aligning the cells of a column to the left.

See Also:
Constant Field Values

CENTER

public static final java.lang.String CENTER
Deprecated. 
The alignment string aligning the cells of a column to its center.

See Also:
Constant Field Values

RIGHT

public static final java.lang.String RIGHT
Deprecated. 
The alignment string aligning the cells of a column to the right.

See Also:
Constant Field Values

DECIMAL

public static final java.lang.String DECIMAL
Deprecated. 
The alignment string aligning the cells of a column to the decimal point.

See Also:
Constant Field Values

alignment

protected java.lang.String alignment
Deprecated. 
The default format string for formatting a single cell value; currently "%G".


format

protected java.lang.String format
Deprecated. 
The default format string for formatting a single cell value; currently "%G".


rowSeparator

protected java.lang.String rowSeparator
Deprecated. 
The default string separating any two rows from another; currently "\n".


sliceSeparator

protected java.lang.String sliceSeparator
Deprecated. 
The default string separating any two slices from another; currently "\n\n".


printShape

protected boolean printShape
Deprecated. 
Tells whether String representations are to be preceded with summary of the shape; currently true.

Constructor Detail

AbstractFormatter

protected AbstractFormatter()
Deprecated. 
Makes this class non instantiable, but still let's others inherit from it.

Method Detail

align

protected void align(java.lang.String[][] strings)
Deprecated. 
Modifies the strings in a column of the string matrix to be aligned (left,centered,right,decimal).


alignmentCode

protected static int alignmentCode(java.lang.String alignment)
Deprecated. 
Converts a row into a string.


alignRow

protected void alignRow(java.lang.String[] row,
                        int[] maxColWidth,
                        int[] maxColLead)
Deprecated. 
Modifies the strings the string matrix to be aligned (left,centered,right,decimal).


blanks

protected static java.lang.String blanks(int length)
Deprecated. 
Returns a String with length blanks.


form

protected abstract java.lang.String form(AbstractMatrix1D matrix,
                                         int index,
                                         Former formatter)
Deprecated. 
Converts a given cell to a String; no alignment considered.


format

protected abstract java.lang.String[][] format(AbstractMatrix2D matrix)
Deprecated. 
Returns a string representations of all cells; no alignment considered.


formatRow

protected java.lang.String[] formatRow(AbstractMatrix1D vector)
Deprecated. 
Returns a string representations of all cells; no alignment considered.


lead

protected int lead(java.lang.String s)
Deprecated. 
Returns the number of characters or the number of characters before the decimal point.


repeat

protected java.lang.String repeat(char character,
                                  int length)
Deprecated. 
Returns a String with the given character repeated length times.


setAlignment

public void setAlignment(java.lang.String alignment)
Deprecated. 
Sets the column alignment (left,center,right,decimal).

Parameters:
alignment - the new alignment to be used; must be one of {LEFT,CENTER,RIGHT,DECIMAL}.

setColumnSeparator

public void setColumnSeparator(java.lang.String columnSeparator)
Deprecated. 
Sets the string separating any two columns from another.

Parameters:
columnSeparator - the new columnSeparator to be used.

setFormat

public void setFormat(java.lang.String format)
Deprecated. 
Sets the way a single cell value is to be formatted.

Parameters:
format - the new format to be used.

setMinColumnWidth

public void setMinColumnWidth(int minColumnWidth)
Deprecated. 
Sets the minimum number of characters a column may have.

Parameters:
minColumnWidth - the new minColumnWidth to be used.

setPrintShape

public void setPrintShape(boolean printShape)
Deprecated. 
Specifies whether a string representation of a matrix is to be preceded with a summary of its shape.

Parameters:
printShape - true shape summary is printed, otherwise not printed.

setRowSeparator

public void setRowSeparator(java.lang.String rowSeparator)
Deprecated. 
Sets the string separating any two rows from another.

Parameters:
rowSeparator - the new rowSeparator to be used.

setSliceSeparator

public void setSliceSeparator(java.lang.String sliceSeparator)
Deprecated. 
Sets the string separating any two slices from another.

Parameters:
sliceSeparator - the new sliceSeparator to be used.

shape

public static java.lang.String shape(AbstractMatrix matrix)
Deprecated. 
Returns a short string representation describing the shape of the matrix.


shape

public static java.lang.String shape(AbstractMatrix2D matrix)
Deprecated. 
Returns a short string representation describing the shape of the matrix.


shape

public static java.lang.String shape(AbstractMatrix3D matrix)
Deprecated. 
Returns a short string representation describing the shape of the matrix.


toString

protected java.lang.String toString(java.lang.String[][] strings)
Deprecated. 
Returns a single string representation of the given string matrix.

Parameters:
strings - the matrix to be converted to a single string.

toString

protected java.lang.String toString(AbstractMatrix2D matrix)
Deprecated. 
Returns a string representation of the given matrix.

Parameters:
matrix - the matrix to convert.


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.