if (parent instanceof Section == false)
{
return -1;
}
final Section br = (Section) parent;
if (parent instanceof RootLevelBand && child instanceof SubReport)
{
final RootLevelBand re = (RootLevelBand) parent;
final int subreportIndexOf = ModelUtility.findSubreportIndexOf(re, (SubReport) child);
if (subreportIndexOf != -1)
{
return br.getElementCount() + subreportIndexOf;
}
}
if (child instanceof Element == false)
{
return -1;
}
if (isStrictOrderNeeded(br))
{
return ModelUtility.findIndexOf(br, (Element) child);
}
else
{
return br.getElementCount() - ModelUtility.findIndexOf(br, (Element) child) - 1;
}
}