// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
//
// Contact: phylosoft @ gmail . com
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
//
// Contact: phylosoft @ gmail . com
final double draw_factor = ( double ) max_count / size;
final int counts_size = ForesterUtil.roundToInt( Math.log10( max_count ) ) + 1;
if ( !ForesterUtil.isEmpty( getTitle() ) ) {
final double draw_factor = ( double ) max_count / size;
final int counts_size = ForesterUtil.roundToInt( Math.log10( max_count ) ) + 1;
if ( !ForesterUtil.isEmpty( getTitle() ) ) {
sb.append( "[" + under + "] " );
sb.append( ForesterUtil.LINE_SEPARATOR );
}
for( int i = 0; i < bins.length; ++i ) {
final int count = bins[ i ];
sb.append( "[" + under + "] " );
sb.append( ForesterUtil.LINE_SEPARATOR );
}
for( int i = 0; i < bins.length; ++i ) {
final int count = bins[ i ];
- final double label = ForesterUtil.round( ( min + i * ( 1.0 / binning_factor ) ), digits );
+ final double label = ForesterUtil.round( ( min + ( i * ( 1.0 / binning_factor ) ) ), digits );
+ if ( !ForesterUtil.isEmpty( indent ) ) {
+ sb.append( indent );
+ }
sb.append( ForesterUtil.pad( label + "", digits, '0', false ) );
sb.append( " [" + ForesterUtil.pad( count + "", counts_size, ' ', true ) + "] " );
final int s = ForesterUtil.roundToInt( count / draw_factor );
sb.append( ForesterUtil.pad( label + "", digits, '0', false ) );
sb.append( " [" + ForesterUtil.pad( count + "", counts_size, ' ', true ) + "] " );
final int s = ForesterUtil.roundToInt( count / draw_factor );
- drawToStringBuffer( min, symbol, size, digits, sb, bins, max_count, 0, 0, binning_factor );
+ drawToStringBuffer( min, symbol, size, digits, sb, bins, max_count, 0, 0, binning_factor, indent );
+ public StringBuffer toStringBuffer( final int bins,
+ final char symbol,
+ final int size,
+ final int digits,
+ final String indent ) {
+ return toStringBuffer( getDescriptiveStatistics().getMin(),
+ getDescriptiveStatistics().getMax(),
+ bins,
+ symbol,
+ size,
+ digits,
+ indent );
+ }
+
public StringBuffer toStringBuffer( final int bins, final char symbol, final int size, final int digits ) {
return toStringBuffer( getDescriptiveStatistics().getMin(),
getDescriptiveStatistics().getMax(),
bins,
symbol,
size,
public StringBuffer toStringBuffer( final int bins, final char symbol, final int size, final int digits ) {
return toStringBuffer( getDescriptiveStatistics().getMin(),
getDescriptiveStatistics().getMax(),
bins,
symbol,
size,