// Nothing to do here.
return super.transform(opSequence, elts) ;
OpSequence seq2 = OpSequence.create() ;
for ( int i = 0 ; i < elts.size() ; i++ )
{
Op op = elts.get(i) ;
BasicPattern p1 = asBGP(op) ;
if ( p1 == null )
{
// Do nothing
seq2.add(op) ;
continue ; // Outer loop.
}
// This is the op after the merge, if any.
BasicPattern pMerge = new BasicPattern() ;
seq2.add(new OpBGP(pMerge)) ;
// Merge any BGPs from here on ...
// Re-gets the BGP that trigegrs this all.
for ( ; i < elts.size() ; i++ )
{
// Look at next element.
Op opNext = elts.get(i) ;
BasicPattern p2 = asBGP(opNext) ;
if ( p2 == null )
{
seq2.add(opNext) ;
break ;
}
// Merge.
pMerge.addAll(p2) ;
}
}
if ( seq2.size() == 1 )
return seq2.get(0) ;
return seq2 ;
}