java - Getting Guava ArrayListMultimap to work -
i'm relatively new java, , working on new analysis method improve current implementation of ((inefficcient) optimally deleting 2's [rows , columns] random [mod(2) + 1] matrix).
i've determined want multimap process dataset. thus, downloaded guava , placed ~2mb file directory. compile programme using multimap or arraylistmultimap with:
javac -classpath c:\mywork\guava-18.0.jar myfile.java
edit: @ advice of user2336315, changed code to:
arraylistmultimap<string, int[]> combinations = arraylistmultimap.create();
this compiles perfectly. however, error when run script 'java optimize':
to see how run code after compiling, please refer reply comments below.
here's current test code:
import java.util.random; import com.google.common.collect.arraylistmultimap; class determine { public static int[][] rando() { // various lines of code product random matrix } } class search { public static void finalize(int[][] a) { int bluejay = a.length; int minimum = 1; arraylistmultimap<string, int[]> combinations = arraylistmultimap.create(); (int x = 0; x < bluejay - minimum + 1; x++) { int y = 0; while (y < 5) { int[] rows = new int[x + 1]; rows[0] = 1; combinations.put(integer.tostring(x), rows); y += 1; } system.out.println(combinations); } } } public class optimize { public static void main(string[] args) { int[][] matrix = determine.rando(); search.finalize(matrix); } }
the constructors of class private, cannot see them outside class. have utilize static method creates map.
arraylistmultimap<string, int[]> combinations = arraylistmultimap.create();
as sec error, don't see guava class name, maybe mispelled it?
java guava
No comments:
Post a Comment