From: erik Date: Thu, 5 Jun 2008 21:01:56 +0000 (+0000) Subject: (no commit message) X-Git-Tag: wamblee-utils-0.2@603~84 X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;h=986c4d0c260012170ae425fd83b74b23451efac4;p=utils --- diff --git a/trunk/system/general/src/main/java/org/wamblee/system/core/ReadWriteNamedInterfaces.java b/trunk/system/general/src/main/java/org/wamblee/system/core/ReadWriteNamedInterfaces.java index 0dcd4187..ea7d4903 100644 --- a/trunk/system/general/src/main/java/org/wamblee/system/core/ReadWriteNamedInterfaces.java +++ b/trunk/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/trunk/system/general/src/main/java/org/wamblee/system/core/ReadWriteProvidedInterfaces.java b/trunk/system/general/src/main/java/org/wamblee/system/core/ReadWriteProvidedInterfaces.java index 8581c939..3c5c1590 100644 --- a/trunk/system/general/src/main/java/org/wamblee/system/core/ReadWriteProvidedInterfaces.java +++ b/trunk/system/general/src/main/java/org/wamblee/system/core/ReadWriteProvidedInterfaces.java @@ -26,6 +26,6 @@ public class ReadWriteProvidedInterfaces extends ReadWriteNamedInterfaces