From 45388b0d4843b79ae151ec099977fd8e449c3214 Mon Sep 17 00:00:00 2001 From: dev <dev@welterde.de> Date: Thu, 28 Jan 2010 20:05:03 +0000 Subject: [PATCH] added an getTargetAddresses(transportStyle) method to the RouterInfo structure --- core/java/src/net/i2p/data/RouterInfo.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/java/src/net/i2p/data/RouterInfo.java b/core/java/src/net/i2p/data/RouterInfo.java index f3e2f48994..523fc45dce 100644 --- a/core/java/src/net/i2p/data/RouterInfo.java +++ b/core/java/src/net/i2p/data/RouterInfo.java @@ -19,6 +19,7 @@ import java.util.Iterator; import java.util.List; import java.util.Properties; import java.util.Set; +import java.util.Vector; import net.i2p.crypto.DSAEngine; import net.i2p.crypto.SHA256Generator; @@ -450,6 +451,18 @@ public class RouterInfo extends DataStructureImpl { } return null; } + + public List<RouterAddress> getTargetAddresses(String transportStyle) { + List<RouterAddress> ret = new Vector<RouterAddress>(); + synchronized(this._addresses) { + for(Object o : this._addresses) { + RouterAddress addr = (RouterAddress)o; + if(addr.getTransportStyle().equals(transportStyle)) + ret.add(addr); + } + } + return ret; + } /** * Actually validate the signature -- GitLab