Hi Again,
I recently installed Xindice 1.0 and have been
creating classes to access the database and iterate
through a collection. I have followed the example
code from the developer section on the website, but it
seems when I access a collection or even a specific
Resource, the ResourceIterator returns redundant
Resources. When I use the following code (see snippet
below), the iterator returns the same document
mulitple times. Is this a known issue or is my code
below flawed? I am certain that the ResourceIterator
returned should not contain a given resource more than
once since the command line tools do not seem to do
this.
Thanks in Advance,
Julian
<snippet>
/**
* Add Task(s) from Result Set
*/
public void addResults(ResourceIterator results) {
try {
TaskManager taskManager = new TaskManager();
XMLResource resource = null;
Task task = null;
while (results.hasMoreResources()) {
// Retrieve the next node
resource = (XMLResource)
results.nextResource();
//parse XMLResource
task =
taskManager.parseXMLResource(resource);
// Add task to group
//try to remove redundant tasks (this does
not seem to work!!)
if(!taskListVector.contains(task)) {
this.add(task);
}
}
}
catch (Exception e) {
e.printStackTrace();
}
}
</snippet>
=====
Live simply so others may simply live.
�
-Ghandi
�
Pluralitas non est ponenda sine neccesitate.
"Entities should not be multiplied unneccesarily"
�
-William of Occam
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com