public final Object exec(List args) throws TemplateModelException { int argCnt = args.size(); checkMethodArgCount(argCnt, 1, 2); TemplateModel searched = (TemplateModel) args.get(0); int foundAtIdx; if (argCnt > 1) { int startIndex = getNumberMethodArg(args, 1).intValue(); // In 2.3, we prefer TemplateSequenceModel for backward compatibility, even if startIndex is 0: foundAtIdx = m_seq != null ? findInSeq(searched, startIndex) : findInCol(searched, startIndex); } else { foundAtIdx = m_seq != null ? findInSeq(searched) : findInCol(searched); } return foundAtIdx == -1 ? Constants.MINUS_ONE : new SimpleNumber(foundAtIdx); }
public final Object exec(List args) throws TemplateModelException { int argCnt = args.size(); checkMethodArgCount(argCnt, 1, 2); TemplateModel searched = (TemplateModel) args.get(0); int foundAtIdx; if (argCnt > 1) { int startIndex = getNumberMethodArg(args, 1).intValue(); // In 2.3, we prefer TemplateSequenceModel for backward compatibility, even if startIndex is 0: foundAtIdx = m_seq != null ? findInSeq(searched, startIndex) : findInCol(searched, startIndex); } else { foundAtIdx = m_seq != null ? findInSeq(searched) : findInCol(searched); } return foundAtIdx == -1 ? Constants.MINUS_ONE : new SimpleNumber(foundAtIdx); }
public final Object exec(List args) throws TemplateModelException { int argCnt = args.size(); checkMethodArgCount(argCnt, 1, 2); TemplateModel searched = (TemplateModel) args.get(0); int foundAtIdx; if (argCnt > 1) { int startIndex = getNumberMethodArg(args, 1).intValue(); // In 2.3, we prefer TemplateSequenceModel for backward compatibility, even if startIndex is 0: foundAtIdx = m_seq != null ? findInSeq(searched, startIndex) : findInCol(searched, startIndex); } else { foundAtIdx = m_seq != null ? findInSeq(searched) : findInCol(searched); } return foundAtIdx == -1 ? Constants.MINUS_ONE : new SimpleNumber(foundAtIdx); }
int findInCol(TemplateModel searched) throws TemplateModelException { return findInCol(searched, 0, Integer.MAX_VALUE); }
int findInCol(TemplateModel searched) throws TemplateModelException { return findInCol(searched, 0, Integer.MAX_VALUE); }
int findInCol(TemplateModel searched) throws TemplateModelException { return findInCol(searched, 0, Integer.MAX_VALUE); }