次のクラスがあるとします。
class A {
String name;
Double value;
}
上記のクラス オブジェクトのリストには、次のものが含まれる可能性があります。
[{f 2.1}, {c 1.1}, {a 0.3}... and so on]
[{n 0.5}, {f 1.9}, {x 0.1}, {a 1.9}, {b 1.1}... and so on]
... and so on
私がしたいのは、次のことをすることだけです:
1. Building power subsets from the internal list items(N.B: skip the single subsets).
2. Push the subset in another List as an object of the above class A like this:
a. if f,c is a subset of 1st element then f,c would be the name property of class A
and the value property will be the minimum of f and c from the list.
Like: {f,c 1.1} [ where f,c is a subset and min of 2.1(value of f)
and 1.1(value of c) is 1.1]
so, from the above list if I take 1st element the subsets and their values
in the pushing list would be like this(after skipping the single subsets):
[{f,c 1.1}, {c,a 0.3}, {f,a 0.3}, {f,c,a 0.3}]
and for the 2nd element this would be:
[{n,f 0.5}, {f,x 0.1}, {x,a 0.1}, {a,b 1.1}, {n,x 0.1}, {n,a 0.5}, {n,b 0.5},
{f,a 1.9}, {f,b 1.1}, {x,b 0.1}, {n,f,x 0.1}, {n,x,a 0.1},
{n,a,b 0.5}, {f,x,a 0.1}, {f,x,b 0.1}, {x,a,b 0.1}, {n,f,x,a 0.1},
{n,f,x,b 0.1}, {n,f,a,b 0.5}, {n,x,a,b 0.1}, {f,x,a,b 0.1},
{n,f,x,a,b 0.1}]
Javaでこれを行う方法を教えてください(可能であればサンプルコードを添えて)。
ありがとう!