I have this class
public class Operation {
private double value;
private boolean inc;
public Operation(double value, boolean inc) {
this.value = value;
this.inc = inc;
}
public double getValue() {
return value;
}
public void setValue(double value) {
this.value = value;
}
public boolean isInc() {
return inc;
}
public void setInc(boolean inc) {
this.inc = inc;
}
@Override
public String toString() {
return "Operation{" + "value=" + value + ", inc=" + inc + '}';
}
}
Now I have this List
public class TestOperation {
public static void main(String[] args) {
List<Operation> listOperation1 = new ArrayList<>();
listOperation1.add(new Operation(1.3, true));
listOperation1.add(new Operation(2.7, true));
listOperation1.add(new Operation(0.9, false));
listOperation1.add(new Operation(0.8, false));
//Generate posible Rotation listOperation1
//Operation(1.3, true), Operation(2.7, true), Operation(0.9, false), Operation(0.8, false)
//Operation(1.3, true), Operation(2.7, true), Operation(0.8, false), Operation(0.9, false)
//Operation(2.7, true), Operation(1.3, true), Operation(0.9, false), Operation(0.8, false)
//Operation(2.7, true), Operation(1.3, true), Operation(0.8, false), Operation(0.9, false)
List<Operation> listOperation2 = new ArrayList<>();
listOperation2.add(new Operation(1.5, true));
listOperation2.add(new Operation(2.9, true));
listOperation2.add(new Operation(4.6, true));
//Generate posible Rotation listOperation2
//Operation(1.5, true), Operation(2.9, true), Operation(4.6, true)
//Operation(1.5, true), Operation(4.6, true), Operation(2.9, true)
//Operation(2.9, true), Operation(4.6, true), Operation(1.5, true)
//Operation(2.9, true), Operation(1.5, true), Operation(4.6, true)
//Operation(4.6, true), Operation(2.9, true), Operation(1.5, true)
//Operation(4.6, true), Operation(1.5, true), Operation(2.9, true)
}
}
The rotation only occurs between inc = true, and inc = false, Not mixed!
The numbers of items inc = true can differs of inc = false. Even, some may not exist.
All submitted items from list must treated, none can be missing, but can't be repeated (like object, not like value).
How generate this rotation?