Created
April 7, 2017 15:10
-
-
Save ncovercash/22841e23714c91c23e521560a8b9c1c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String expandNumToDigits(int in, int digits) { | |
String stringIn = ""+in; | |
while (stringIn.length() < digits) { | |
stringIn = "0"+stringIn; | |
} | |
return stringIn; | |
} | |
public String toString() { | |
String str = ""; | |
for (int row=0; row<list.length; row++) { | |
str += "[ "; | |
for (int col=0; col<list[row].length; col++) { | |
if (list[row][col] instanceof FilledRect) { | |
str += "FilledRect-"+expandNumToDigits(getTotalColorVals(list[row][col].getColor()), 3)+" "; // FilledRect-055 e.g. | |
} else if (list[row][col] instanceof FramedRect) { | |
str += "FramedRect-"+expandNumToDigits(getTotalColorVals(list[row][col].getColor()), 3)+" "; // FilledRect-055 e.g. | |
} else if (list[row][col] instanceof FilledOval) { | |
str += "FilledOval-"+expandNumToDigits(getTotalColorVals(list[row][col].getColor()), 3)+" "; // FilledRect-055 e.g. | |
} else { | |
str += "FramedOval-"+expandNumToDigits(getTotalColorVals(list[row][col].getColor()), 3)+" "; // FilledRect-055 e.g. | |
} | |
} | |
str += "]\n"; | |
} | |
return str; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment