From 8b32e0ba280eeda4a35aaefcde6467dd6bce2f79 Mon Sep 17 00:00:00 2001 From: erik Date: Thu, 5 Jun 2008 21:01:56 +0000 Subject: [PATCH] --- .../system/core/ReadWriteNamedInterfaces.java | 31 +++---------------- .../core/ReadWriteProvidedInterfaces.java | 2 +- .../core/ReadWriteRequiredInterfaces.java | 2 +- 3 files changed, 7 insertions(+), 28 deletions(-) diff --git a/system/general/src/main/java/org/wamblee/system/core/ReadWriteNamedInterfaces.java b/system/general/src/main/java/org/wamblee/system/core/ReadWriteNamedInterfaces.java index 0dcd4187..ea7d4903 100644 --- a/system/general/src/main/java/org/wamblee/system/core/ReadWriteNamedInterfaces.java +++ b/system/general/src/main/java/org/wamblee/system/core/ReadWriteNamedInterfaces.java @@ -20,43 +20,22 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; -public class ReadWriteNamedInterfaces implements Iterable { - - protected List _interfaces; +public class ReadWriteNamedInterfaces extends ArrayList { public ReadWriteNamedInterfaces() { - _interfaces = new ArrayList(); + // Empty. } public ReadWriteNamedInterfaces(T[] aInterfaces) { - _interfaces = new ArrayList(); - _interfaces.addAll(Arrays.asList(aInterfaces)); - } - - public int size() { - return _interfaces.size(); + addAll(Arrays.asList(aInterfaces)); } - - public T get(int aIndex) { - return _interfaces.get(aIndex); - } - + public T get(String aName) { - for (T intf: _interfaces) { + for (T intf: this) { if ( intf.getName().equals(aName)) { return intf; } } return null; } - - public void add(T aInterface) { - _interfaces.add(aInterface); - } - - @Override - public Iterator iterator() { - return _interfaces.iterator(); - } - } diff --git a/system/general/src/main/java/org/wamblee/system/core/ReadWriteProvidedInterfaces.java b/system/general/src/main/java/org/wamblee/system/core/ReadWriteProvidedInterfaces.java index 8581c939..3c5c1590 100644 --- a/system/general/src/main/java/org/wamblee/system/core/ReadWriteProvidedInterfaces.java +++ b/system/general/src/main/java/org/wamblee/system/core/ReadWriteProvidedInterfaces.java @@ -26,6 +26,6 @@ public class ReadWriteProvidedInterfaces extends ReadWriteNamedInterfaces