Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.help')
-rw-r--r--org.eclipse.help/src/org/eclipse/help/internal/index/Index.java14
-rw-r--r--org.eclipse.help/src/org/eclipse/help/internal/index/IndexEntry.java5
2 files changed, 14 insertions, 5 deletions
diff --git a/org.eclipse.help/src/org/eclipse/help/internal/index/Index.java b/org.eclipse.help/src/org/eclipse/help/internal/index/Index.java
index cea4e52f7..4ad7e23c3 100644
--- a/org.eclipse.help/src/org/eclipse/help/internal/index/Index.java
+++ b/org.eclipse.help/src/org/eclipse/help/internal/index/Index.java
@@ -12,6 +12,8 @@ package org.eclipse.help.internal.index;
import java.util.Collection;
import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.TreeMap;
@@ -37,11 +39,19 @@ public class Index implements IIndex {
public Index() {
entries = new TreeMap(new IgnoreCaseComparator());
}
-
+
+ public Index(List entries) {
+ this();
+ for (Iterator i = entries.iterator(); i.hasNext();) {
+ IndexEntry entry = (IndexEntry)i.next();
+ this.entries.put(entry.getKeyword(), entry);
+ }
+ }
+
/* (non-Javadoc)
* @see org.eclipse.help.internal.index.IIndex#addEntry(java.lang.String, java.util.Collection)
*/
- public IndexEntry addEntry(String keyword) {
+ protected IndexEntry addEntry(String keyword) {
IndexEntry oldEntry = (IndexEntry) entries.get(keyword);
if (oldEntry == null) {
oldEntry = new IndexEntry(keyword);
diff --git a/org.eclipse.help/src/org/eclipse/help/internal/index/IndexEntry.java b/org.eclipse.help/src/org/eclipse/help/internal/index/IndexEntry.java
index a7082fe1a..19d0e40d6 100644
--- a/org.eclipse.help/src/org/eclipse/help/internal/index/IndexEntry.java
+++ b/org.eclipse.help/src/org/eclipse/help/internal/index/IndexEntry.java
@@ -12,7 +12,6 @@ package org.eclipse.help.internal.index;
import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
import org.eclipse.help.IHelpResource;
import org.eclipse.help.IIndexEntry;
@@ -35,10 +34,10 @@ public class IndexEntry extends Index implements IIndexEntry {
this.topics = topics;
}
- public IndexEntry(String keyword, List topics, Map subentries) {
+ public IndexEntry(String keyword, List topics, List subentries) {
+ super(subentries);
this.keyword = keyword;
this.topics = topics;
- this.entries = subentries;
}
public void addTopic(String label, String href, String location) {

Back to the top