summaryrefslogtreecommitdiff
path: root/src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy')
-rw-r--r--src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/Hierarchical.java7
-rw-r--r--src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/Hierarchy.java7
-rw-r--r--src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/HierarchyHashmapList.java19
-rw-r--r--src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/HierarchyReferenceLists.java19
4 files changed, 14 insertions, 38 deletions
diff --git a/src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/Hierarchical.java b/src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/Hierarchical.java
index 697ac640..29909069 100644
--- a/src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/Hierarchical.java
+++ b/src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/Hierarchical.java
@@ -23,10 +23,9 @@ package de.lmu.ifi.dbs.elki.utilities.datastructures.hierarchy;
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+import java.util.Iterator;
import java.util.List;
-import de.lmu.ifi.dbs.elki.utilities.iterator.IterableIterator;
-
/**
* Interface for objects with an <b>internal</b> hierarchy interface.
@@ -65,7 +64,7 @@ public interface Hierarchical<O> {
*
* @return iterator for descendants
*/
- public IterableIterator<O> iterDescendants();
+ public Iterator<O> iterDescendants();
/**
* Get number of parents
@@ -87,5 +86,5 @@ public interface Hierarchical<O> {
*
* @return iterator for ancestors
*/
- public IterableIterator<O> iterAncestors();
+ public Iterator<O> iterAncestors();
} \ No newline at end of file
diff --git a/src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/Hierarchy.java b/src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/Hierarchy.java
index 3a3c4d45..0a16e9b7 100644
--- a/src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/Hierarchy.java
+++ b/src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/Hierarchy.java
@@ -23,10 +23,9 @@ package de.lmu.ifi.dbs.elki.utilities.datastructures.hierarchy;
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+import java.util.Iterator;
import java.util.List;
-import de.lmu.ifi.dbs.elki.utilities.iterator.IterableIterator;
-
/**
* This interface represents an (external) hierarchy of objects. It can contain
* arbitrary objects, BUT the hierarchy has to be accessed using the hierarchy
@@ -63,7 +62,7 @@ public interface Hierarchy<O> {
* @param self object to get descendants for
* @return iterator for descendants
*/
- public IterableIterator<O> iterDescendants(O self);
+ public Iterator<O> iterDescendants(O self);
/**
* Get number of (direct) parents
@@ -88,5 +87,5 @@ public interface Hierarchy<O> {
* @param self object to get ancestors for
* @return iterator for ancestors
*/
- public IterableIterator<O> iterAncestors(O self);
+ public Iterator<O> iterAncestors(O self);
} \ No newline at end of file
diff --git a/src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/HierarchyHashmapList.java b/src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/HierarchyHashmapList.java
index d09e6d94..76bee0f9 100644
--- a/src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/HierarchyHashmapList.java
+++ b/src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/HierarchyHashmapList.java
@@ -31,7 +31,6 @@ import java.util.List;
import de.lmu.ifi.dbs.elki.logging.LoggingUtil;
import de.lmu.ifi.dbs.elki.utilities.iterator.EmptyIterator;
-import de.lmu.ifi.dbs.elki.utilities.iterator.IterableIterator;
/**
* Centralized hierarchy implementation, using a HashMap of Lists.
@@ -149,7 +148,7 @@ public class HierarchyHashmapList<O> implements ModifiableHierarchy<O> {
}
@Override
- public IterableIterator<O> iterDescendants(O obj) {
+ public Iterator<O> iterDescendants(O obj) {
return new ItrDesc(obj);
}
@@ -172,7 +171,7 @@ public class HierarchyHashmapList<O> implements ModifiableHierarchy<O> {
}
@Override
- public IterableIterator<O> iterAncestors(O obj) {
+ public Iterator<O> iterAncestors(O obj) {
return new ItrAnc(obj);
}
@@ -183,7 +182,7 @@ public class HierarchyHashmapList<O> implements ModifiableHierarchy<O> {
*
* @apiviz.exclude
*/
- private class ItrDesc implements IterableIterator<O> {
+ private class ItrDesc implements Iterator<O> {
/**
* Starting object (for cloning);
*/
@@ -235,11 +234,6 @@ public class HierarchyHashmapList<O> implements ModifiableHierarchy<O> {
public void remove() {
throw new UnsupportedOperationException();
}
-
- @Override
- public Iterator<O> iterator() {
- return new ItrDesc(start);
- }
}
/**
@@ -249,7 +243,7 @@ public class HierarchyHashmapList<O> implements ModifiableHierarchy<O> {
*
* @apiviz.exclude
*/
- private class ItrAnc implements IterableIterator<O> {
+ private class ItrAnc implements Iterator<O> {
/**
* Starting object (for cloning);
*/
@@ -301,10 +295,5 @@ public class HierarchyHashmapList<O> implements ModifiableHierarchy<O> {
public void remove() {
throw new UnsupportedOperationException();
}
-
- @Override
- public Iterator<O> iterator() {
- return new ItrAnc(start);
- }
}
} \ No newline at end of file
diff --git a/src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/HierarchyReferenceLists.java b/src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/HierarchyReferenceLists.java
index f6c527ab..76091298 100644
--- a/src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/HierarchyReferenceLists.java
+++ b/src/de/lmu/ifi/dbs/elki/utilities/datastructures/hierarchy/HierarchyReferenceLists.java
@@ -27,7 +27,6 @@ import java.util.Iterator;
import java.util.List;
import de.lmu.ifi.dbs.elki.utilities.iterator.EmptyIterator;
-import de.lmu.ifi.dbs.elki.utilities.iterator.IterableIterator;
/**
* Hierarchy implementation with a per-object representation.
@@ -88,7 +87,7 @@ public class HierarchyReferenceLists<O extends Hierarchical<O>> implements Hiera
}
@Override
- public IterableIterator<O> iterDescendants(O self) {
+ public Iterator<O> iterDescendants(O self) {
if(owner != self) {
return EmptyIterator.STATIC();
}
@@ -121,7 +120,7 @@ public class HierarchyReferenceLists<O extends Hierarchical<O>> implements Hiera
}
@Override
- public IterableIterator<O> iterAncestors(O self) {
+ public Iterator<O> iterAncestors(O self) {
if(owner != self) {
throw new UnsupportedOperationException("Decentral hierarchy queried for wrong object!");
}
@@ -138,7 +137,7 @@ public class HierarchyReferenceLists<O extends Hierarchical<O>> implements Hiera
*
* @apiviz.exclude
*/
- private class ItrDesc implements IterableIterator<O> {
+ private class ItrDesc implements Iterator<O> {
/**
* Iterator over children
*/
@@ -179,11 +178,6 @@ public class HierarchyReferenceLists<O extends Hierarchical<O>> implements Hiera
public void remove() {
throw new UnsupportedOperationException();
}
-
- @Override
- public Iterator<O> iterator() {
- return new ItrDesc(owner);
- }
}
/**
@@ -193,7 +187,7 @@ public class HierarchyReferenceLists<O extends Hierarchical<O>> implements Hiera
*
* @apiviz.exclude
*/
- private class ItrAnc implements IterableIterator<O> {
+ private class ItrAnc implements Iterator<O> {
/**
* Iterator over parents
*/
@@ -234,10 +228,5 @@ public class HierarchyReferenceLists<O extends Hierarchical<O>> implements Hiera
public void remove() {
throw new UnsupportedOperationException();
}
-
- @Override
- public Iterator<O> iterator() {
- return new ItrAnc(owner);
- }
}
} \ No newline at end of file