comparison at/ofai/music/util/ArrayPrint.java @ 2:4c3f5bc01c97

* Import BeatRoot v0.5.7
author Chris Cannam
date Fri, 08 Oct 2010 16:11:06 +0100
parents
children
comparison
equal deleted inserted replaced
1:4de8d7f01bd4 2:4c3f5bc01c97
1 /*
2 Copyright (C) 2001, 2006 by Simon Dixon
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program (the file gpl.txt); if not, download it from
16 http://www.gnu.org/licenses/gpl.txt or write to the
17 Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21 package at.ofai.music.util;
22
23 public class ArrayPrint {
24
25 public static void show(String s, double[] arr, int line) {
26 System.out.println(s + " (length = " + arr.length + ")");
27 for (int i = 0; i < arr.length; i++) {
28 System.out.printf("%7.3f ", arr[i]);
29 if (i % line == line - 1)
30 System.out.println();
31 }
32 System.out.println();
33 } // show()
34
35 void show(String s, int[] arr, int line) {
36 System.out.println(s + " (length = " + arr.length + ")");
37 for (int i = 0; i < arr.length; i++) {
38 System.out.printf("%7d ", arr[i]);
39 if (i % line == line - 1)
40 System.out.println();
41 }
42 System.out.println();
43 } // show()
44
45 }