equal
deleted
inserted
replaced
922 |
922 |
923 /** |
923 /** |
924 * Returns the starting position of the first occurrence of the specified |
924 * Returns the starting position of the first occurrence of the specified |
925 * target list within the specified source list, or -1 if there is no |
925 * target list within the specified source list, or -1 if there is no |
926 * such occurrence. More formally, returns the lowest index <tt>i</tt> |
926 * such occurrence. More formally, returns the lowest index <tt>i</tt> |
927 * such that <tt>source.subList(i, i+target.size()).equals(target)</tt>, |
927 * such that {@code source.subList(i, i+target.size()).equals(target)}, |
928 * or -1 if there is no such index. (Returns -1 if |
928 * or -1 if there is no such index. (Returns -1 if |
929 * <tt>target.size() > source.size()</tt>.) |
929 * {@code target.size() > source.size()}) |
930 * |
930 * |
931 * <p>This implementation uses the "brute force" technique of scanning |
931 * <p>This implementation uses the "brute force" technique of scanning |
932 * over the source list, looking for a match with the target at each |
932 * over the source list, looking for a match with the target at each |
933 * location in turn. |
933 * location in turn. |
934 * |
934 * |
975 |
975 |
976 /** |
976 /** |
977 * Returns the starting position of the last occurrence of the specified |
977 * Returns the starting position of the last occurrence of the specified |
978 * target list within the specified source list, or -1 if there is no such |
978 * target list within the specified source list, or -1 if there is no such |
979 * occurrence. More formally, returns the highest index <tt>i</tt> |
979 * occurrence. More formally, returns the highest index <tt>i</tt> |
980 * such that <tt>source.subList(i, i+target.size()).equals(target)</tt>, |
980 * such that {@code source.subList(i, i+target.size()).equals(target)}, |
981 * or -1 if there is no such index. (Returns -1 if |
981 * or -1 if there is no such index. (Returns -1 if |
982 * <tt>target.size() > source.size()</tt>.) |
982 * {@code target.size() > source.size()}) |
983 * |
983 * |
984 * <p>This implementation uses the "brute force" technique of iterating |
984 * <p>This implementation uses the "brute force" technique of iterating |
985 * over the source list, looking for a match with the target at each |
985 * over the source list, looking for a match with the target at each |
986 * location in turn. |
986 * location in turn. |
987 * |
987 * |