public Tuple Next(TupleListIterator inputOp)
throws ActivityUserException, ActivityProcessingException, ActivityTerminatedException
{
if(resultForCurrentVi != null && resultForCurrentVi.size()>0) {
Tuple ret = new SimpleTuple((Vector)resultForCurrentVi.remove(0));
if(resultForCurrentVi.size()==0) {
currentIndexVector++;
}
return ret;
}
if(sizeVector<=currentIndexVector) {
lastIn = (Tuple)inputOp.nextValue();
if(lastIn==null)
{
return null;
}
else {
sizeVector = ((Vector)lastIn.getObject(1)).size();
currentIndexVector=0;
}
}
String s = (String)((Vector)lastIn.getObject(1)).get(currentIndexVector);
String[] items = s.split(" ");
if(items.length==1) {
Vector dummy = new Vector();
//id
dummy.add(lastIn.getString(0));
//item
dummy.add(items[0]);
currentIndexVector++;
return new SimpleTuple(dummy);
} else {
resultForCurrentVi = GetPowerSet(lastIn.getString(0),items);
return new SimpleTuple((Vector)resultForCurrentVi.remove(0));
}
}