So I am trying to create an AList
of AClass(es)
with a 7-switch String
parameter where each character is either on [1] or off [0], E.g: 0011010
.
ArrayList<AClass> AList = new ArrayList<AClass>();
public BClass() {
// I believe there is 128 unique ways to arrange between 0000000 and 1111111
for (int i = 0; i < ?; i++) {
// I assume I would need to create the String some how here and use that.
String str;
AList.add(new AClass("0000000"));
/ * Each loop would create a new one, you get the idea.
AList.add(new AClass("1000000"));
AList.add(new AClass("1100000"));
AList.add(new AClass("1110000"));
...
...
AList.add(new AClass("1001010"));
...
...
AList.add(new AClass("1111111"));
*/
}
}
What is the most efficient way to create all 128 unique parameter AClass(es)?
Edited: Mistakenly started at 0000001 instead of 1000000