27282930313233343536
} public void update(HealthUnit unit) throws RepositoryException, ObjectNotFoundException { int i = getIndex(unit.getId()); if (i == indice) { throw new ObjectNotFoundException("Health unit not found"); } else { vetor[i] = unit; } }
5152535455565758
return ponteiro < indice; } public IteratorDsk getHealthUnitList() throws RepositoryException, ObjectNotFoundException { if (indice == 0) throw new ObjectNotFoundException("There isn't registered Health units"); return new ConcreteIterator(Arrays.asList(vetor)); }
767778798081828384
} if (! response.isEmpty()) { return new ConcreteIterator(response); } else { throw new ObjectNotFoundException( "There isn't registered health units for the specialty"); } }
979899100101102103104105106107
public HealthUnit search(Long code) throws RepositoryException, ObjectNotFoundException { HealthUnit response = null; int i = getIndex(code); if (i == indice) { throw new ObjectNotFoundException("Health unit not found"); } else { response = vetor[i]; } return response; }
115116117118119120121122123124125
} public void remove(Long code) throws RepositoryException, ObjectNotFoundException { int i = getIndex(code); if (i == indice) { throw new ObjectNotFoundException("Health unit not found"); } else { vetor[i] = vetor[indice - 1]; indice = indice - 1; } }
public void update(DiseaseType tp) throws RepositoryException, ObjectNotFoundException, ObjectNotValidException { int i = getIndex(tp.getId()); if (i == indice) { throw new ObjectNotFoundException("Disease not found"); } else { vetor[i] = tp; } }
6364656667686970717273
public DiseaseType search(Long code) throws RepositoryException, ObjectNotFoundException { DiseaseType response = null; int i = getIndex(code); if (i == indice) { throw new ObjectNotFoundException("Disease not found"); } else { response = vetor[i]; } return response; }
8182838485868788899091
} public void remove(Long code) throws RepositoryException, ObjectNotFoundException { int i = getIndex(code); if (i == indice) { throw new ObjectNotFoundException("Disease not found"); } else { vetor[i] = vetor[indice - 1]; indice = indice - 1; } }
3132333435363738394041
public void update(Employee employee) throws ObjectNotFoundException { synchronized (this) { int i = getIndex(employee.getLogin()); if (i == index) { throw new ObjectNotFoundException("Employee not found"); } else { vector[i] = employee; } } }
5051525354555657585960
public Employee search(String login) throws ObjectNotFoundException { synchronized (this) { Employee response = null; int i = getIndex(login); if (i == index) { throw new ObjectNotFoundException("Employee not found"); } else { response = vector[i]; } return response; }