/** * Find the closest previous instruction from the current iterator * position that matches the given one, according to the * {@link Object#equals} methods of the instruction types. This allows * for matching based on template instructions, as the equals methods of * most instructions return true if the information for the given * instruction has not been filled in. If a match is found, the iterator * is placed before the matching Instruction. If no match is found, * moves the iterator to {@link #beforeFirst}. * * @return true if match found */ public boolean searchBackward(Instruction template) { if (template == null) return false; while (hasPrevious()) if (template.equalsInstruction(previous())) return true; return false; }
/** * Find the closest previous instruction from the current iterator * position that matches the given one, according to the * {@link Object#equals} methods of the instruction types. This allows * for matching based on template instructions, as the equals methods of * most instructions return true if the information for the given * instruction has not been filled in. If a match is found, the iterator * is placed before the matching Instruction. If no match is found, * moves the iterator to {@link #beforeFirst}. * * @return true if match found */ public boolean searchBackward(Instruction template) { if (template == null) return false; while (hasPrevious()) if (template.equalsInstruction(previous())) return true; return false; }
int backupCount = 3; templateIns = code.previous(); if (!code.hasPrevious()) return null; prevIns = code.previous(); && code.hasPrevious()) { prevIns = code.previous(); backupCount++; if (!code.hasPrevious()) return null; earlierIns = code.previous();
int backupCount = 3; templateIns = code.previous(); if (!code.hasPrevious()) return null; prevIns = code.previous(); && code.hasPrevious()) { prevIns = code.previous(); backupCount++; if (!code.hasPrevious()) return null; earlierIns = code.previous();
int backupCount = 3; templateIns = code.previous(); if (!code.hasPrevious()) return null; prevIns = code.previous(); && code.hasPrevious()) { prevIns = code.previous(); backupCount++; if (!code.hasPrevious()) return null; earlierIns = code.previous();
int backupCount = 3; templateIns = code.previous(); if (!code.hasPrevious()) return null; prevIns = code.previous(); && code.hasPrevious()) { prevIns = code.previous(); backupCount++; if (!code.hasPrevious()) return null; earlierIns = code.previous();
int backupCount = 3; templateIns = code.previous(); if (!code.hasPrevious()) return null; prevIns = code.previous(); && code.hasPrevious()) { prevIns = code.previous(); backupCount++; if (!code.hasPrevious()) return null; earlierIns = code.previous();