/** * Returns a string representation of the given matrix. * @param matrix the matrix to convert. */ protected String toString(AbstractMatrix2D matrix) { String[][] strings = this.format(matrix); align(strings); StringBuffer total = new StringBuffer(toString(strings)); if (printShape) total.insert(0, shape(matrix) + "\n"); return total.toString(); } }
int align = alignmentCode(alignment); //{-1,0,1,2} = {left,centered,right,decimal point} StringBuffer s = new StringBuffer(); s.append(blanks(maxColWidth[column] - s.length())); s.append(c); s.append(blanks(maxColLead[column] - lead(c))); s.append(c); s.append(blanks(maxColWidth[column] - s.length())); s.append(blanks((maxColWidth[column] - c.length()) / 2)); s.append(c); s.append(blanks(maxColWidth[column] - s.length())); s.append(blanks(maxColWidth[column] - s.length()));
/** * Returns a string representation of the receiver's shape. */ public String toStringShort() { return AbstractFormatter.shape(this); } /**
/** * Returns a string representation of the given matrix. * @param matrix the matrix to convert. */ public String toString(ObjectMatrix2D matrix) { return super.toString(matrix); } /**
/** * Returns the number of characters before the decimal point. */ protected int lead(String s) { if (alignment.equals(DECIMAL)) return indexOfDecimalPoint(s); return super.lead(s); } /**
/** * Returns a String with the given character repeated <tt>length</tt> times. */ protected String repeat(char character, int length) { if (character==' ') return blanks(length); if (length < 0) length = 0; StringBuffer buf = new StringBuffer(length); for (int k = 0; k < length; k++) { buf.append(character); } return buf.toString(); } /**
/** * Returns a string representations of all cells; no alignment considered. */ protected String[] formatRow(AbstractMatrix1D vector) { Former formatter = null; formatter = factory.create(format); int s = vector.size(); String[] strings = new String[s]; for (int i=0; i<s; i++) { strings[i] = form(vector,i,formatter); } return strings; } /**
int align = alignmentCode(alignment); //{-1,0,1,2} = {left,centered,right,decimal point} StringBuffer s = new StringBuffer(); s.append(blanks(maxColWidth[column] - s.length())); s.append(c); s.append(blanks(maxColLead[column] - lead(c))); s.append(c); s.append(blanks(maxColWidth[column] - s.length())); s.append(blanks((maxColWidth[column] - c.length()) / 2)); s.append(c); s.append(blanks(maxColWidth[column] - s.length())); s.append(blanks(maxColWidth[column] - s.length()));
/** * Returns a string representation of the receiver's shape. */ public String toStringShort() { return AbstractFormatter.shape(this); } /**
/** * Returns a string representation of the given matrix. * @param matrix the matrix to convert. */ public String toString(DoubleMatrix2D matrix) { return super.toString(matrix); } /**
/** * Returns the number of characters before the decimal point. */ protected int lead(String s) { if (alignment.equals(DECIMAL)) return indexOfDecimalPoint(s); return super.lead(s); } /**
/** * Returns a String with the given character repeated <tt>length</tt> times. */ protected String repeat(char character, int length) { if (character==' ') return blanks(length); if (length < 0) length = 0; StringBuffer buf = new StringBuffer(length); for (int k = 0; k < length; k++) { buf.append(character); } return buf.toString(); } /**
/** * Returns a string representations of all cells; no alignment considered. */ protected String[] formatRow(AbstractMatrix1D vector) { Former formatter = null; formatter = factory.create(format); int s = vector.size(); String[] strings = new String[s]; for (int i=0; i<s; i++) { strings[i] = form(vector,i,formatter); } return strings; } /**
/** * Returns a string representation of the given matrix. * @param matrix the matrix to convert. */ protected String toString(AbstractMatrix2D matrix) { String[][] strings = this.format(matrix); align(strings); StringBuffer total = new StringBuffer(toString(strings)); if (printShape) total.insert(0, shape(matrix) + "\n"); return total.toString(); } }
/** * Returns a string representation of the receiver's shape. */ public String toStringShort() { return AbstractFormatter.shape(this); } /**
/** * Returns a string representation of the given matrix. * @param matrix the matrix to convert. */ public String toString(DoubleMatrix2D matrix) { return super.toString(matrix); } /**
/** * Returns a string representation of the receiver's shape. */ public String toStringShort() { return AbstractFormatter.shape(this); } /**
/** * Returns a string representation of the given matrix. * @param matrix the matrix to convert. */ public String toString(ObjectMatrix2D matrix) { return super.toString(matrix); } /**