boolean deleted = (((Node) result.get(stateIndex))).toString().equals(deletedState);
boolean deleted = !(((Node) result.get(stateIndex))).getValue().equals(MODEL.ACTIVE.uri);
    public Object next() throws RepositoryException {        try {            if (results.hasNext()) {                List result = results.next();                                String pid = (((Node) result.get(itemIndex))).getValue()                        .replace("info:fedora/", "");                String itemID = ((Node) result.get(itemIDIndex)).getValue();                                String date = formatDate(((Node) result.get(dateIndex)).toString());                boolean deleted = (((Node) result.get(stateIndex))).toString().equals(deletedState);                            String recordDiss = this.recordDiss.replace("*", pid);                                String aboutDiss = "";                if (aboutDissIndex != -1) {                    aboutDiss = this.aboutDiss.replace("*", pid);                }                             /*                  * Build a set of setSpecs.  This assumes that the results are                 * grouped by itemID                 */                Set setSpecs = new HashSet();                if (setSpecIndex != -1) {                    Node setSpecResult = ((Node) result.get(setSpecIndex));                    if (setSpecResult != null) {                        setSpecs.add(setSpecResult.getValue());                    }                    if (results.peek() != null) {                        while (results.peek().get(itemIDIndex).toString().equals(itemID)) {                            List nextEntry = results.next();                            setSpecResult = (Node) nextEntry.get(setSpecIndex);                                                     if (setSpecResult != null) {                                setSpecs.add(setSpecResult.getValue());                            }                            if (results.peek() == null) {break;}                        }                    }                }                                 /* All this to create an array[] of the correct type */                String[] setSpecList = new String[setSpecs.size()];                int i = 0;                Iterator setSpecMembers = setSpecs.iterator();                while (setSpecMembers.hasNext()) {                    setSpecList[i] = (String) setSpecMembers.next();                    i++;                }                                                return new FedoraRecord(this.client, itemID, this.mdPrefix, recordDiss,                         date, deleted, (String[]) setSpecList, aboutDiss);            } else {                throw new RepositoryException("No more results available\n");            }        } catch (SQLException e) {            logger.error("Could not read recors result", e);            throw new RepositoryException("Could not read record result", e);        }    }