亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? routeadvertisement.java

?? jxta平臺的開發包
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
                        if (hid == null) {                continue; //may be null            }                        if (pid.equals(hid)) {                return true;            }        }        return false;    }        /**     * check if the route has a loop     *     * @return boolean true or false if the route has a loop     */    public boolean hasALoop() {        // Now check for any other potential loops.        Vector peers = new Vector();        for (int i=0; i < hops.size(); ++i) {            try {                PeerID pid = ((AccessPointAdvertisement)                hops.elementAt(i)).getPeerID();                if (pid == null)                    return true; //bad route                if (peers.contains(pid)) {                    // This is a loop.                    return true;                } else {                    peers.add(pid);                }            } catch (Exception ez1) {                return true;            }        }        return false;    }        /**     * return the length of the route     *     * @return int size of the route     */    public int size() {        return hops.size();    }        /**     * get the nexthop after the given hop     *     * @param pid PeerID of the current hop     * @return ap AccessPointAdvertisement of the next Hop     */    public AccessPointAdvertisement nextHop(PeerID pid) {                AccessPointAdvertisement nextHop = null;                // check if we have a real route        if ((hops == null) || (hops.size() == 0)) {            // Empty vector.            return null;        }                // find the index of the route        int index = 0;        boolean found = false;        for (Enumeration e = hops.elements(); e.hasMoreElements();) {            AccessPointAdvertisement ap =            (AccessPointAdvertisement) e.nextElement();            if (pid.toString().equals(ap.getPeerID().toString())) {                found = true;                break;            }            index++;        }                // check if we found the local peer within the vector                if (!found) {            // The peer is not into the vector. Since we have got that            // message, the best we can do is to send it to the first gateway            // in the forward path.            try {                nextHop =  (AccessPointAdvertisement) hops.elementAt(0);            } catch (Exception ez1) {                // Should not fail, but if it does, there is not much we can do                return null;            }            return nextHop;        }        // Found the peer within the vector of hops. Get the next        // hop        try {            nextHop =  (AccessPointAdvertisement) hops.elementAt(index + 1);        } catch (Exception ez1) {            // There is no next hop            return null;        }        return nextHop;    }        /**     * Generate a string that displays the route     * information for logging or debugging purpose     *     * @return String return a string containing the route info     */    public String display() {                StringBuffer routeBuf = new StringBuffer();                routeBuf.append( "Route to PID=" );                PeerID peerId = getDest().getPeerID();                // XXX Sometimes the embedded APA doesn't have the peer id set.        if (peerId == null) {            peerId = destPeer;        }                if (peerId == null) {            routeBuf.append("<null>");        }        else            routeBuf.append(peerId.toString());                Iterator each = getDest().getVectorEndpointAddresses().iterator();        while (each.hasNext()) {            try {                routeBuf.append( "\n Addr=" + (String) each.next() );            } catch (ClassCastException ex) {                routeBuf.append( "\n Addr=bad address");            }        }                int i = 1;        Enumeration e = getHops();        while( e.hasMoreElements() ) {            if (i == 1) {                routeBuf.append( "\n Gateways = " );            }                        peerId = ((AccessPointAdvertisement) e.nextElement()).getPeerID();            if (peerId == null)                routeBuf.append("Null Hop");            else                routeBuf.append( "\n\t[" + i++ + "] " + peerId);        }                return routeBuf.toString();    }        /**     * remove a hop from the list of hops     *     * @param pid peer id of the hop     * @return boolean true or false if the hop is found in the route     */    public boolean removeHop(PeerID pid) {                // FIXME: This is ridiculous, hops is a vector. We can remove        // any item, we do not have to through the enum copying items 1 by 1.                Vector newHops = new Vector();        for (Enumeration e = hops.elements(); e.hasMoreElements();) {            AccessPointAdvertisement hop = (AccessPointAdvertisement)            e.nextElement();            PeerID hid = hop.getPeerID();            if (hid != null) {                if (pid.toString().equals(hid.toString()))                    continue;            }            // add the other one            newHops.add(hop);        }        setHops(newHops);        return true;    }            /**     * return a hop from the list of hops     *     * @param pid peer id of the hop     * @return accesspointadvertisement of the corresponding hop     */    public AccessPointAdvertisement getHop(PeerID pid) {        for (Enumeration e = hops.elements(); e.hasMoreElements();) {            AccessPointAdvertisement hop = (AccessPointAdvertisement)            e.nextElement();            PeerID hid = hop.getPeerID();            if (hid != null) {                if (pid.toString().equals(hid.toString()))                    return (AccessPointAdvertisement) hop.clone();            }        }        return null;    }        /**     * replace a hop from the list of hops     *     * @param ap accesspointadvertisement of the hop to replace     */    public void replaceHop(AccessPointAdvertisement ap) {        int index = 0;        for (Enumeration e = hops.elements(); e.hasMoreElements();) {            AccessPointAdvertisement hop = (AccessPointAdvertisement)            e.nextElement();            PeerID hid = hop.getPeerID();            if (hid != null) {                if (ap.getPeerID().toString().equals(hid.toString())) {                    hops.setElementAt(ap, index);                    return;                }            }        }    }        /**     * Add a new endpointaddress to a hop     *     * @param pid id of the hop     * @param addr new endpoint address to add     */    public void addEndpointAddressToHop(PeerID pid, EndpointAddress addr) {        Vector ea = new Vector();        ea.add(addr.toString());                AccessPointAdvertisement oldHop = getHop(pid);        if (oldHop != null && !oldHop.contains(addr)) {            oldHop.addEndpointAddresses(ea);            replaceHop(oldHop);        }    }        /**     * remove an endpointaddress to a hop     *     * @param pid id of the hop     * @param addr new endpoint address to remove     */    public void removeEndpointAddressToHop(PeerID pid, EndpointAddress addr) {        Vector ea = new Vector();        ea.add(addr.toString());                AccessPointAdvertisement oldHop = getHop(pid);        if (oldHop != null && !oldHop.contains(addr)) {            oldHop.removeEndpointAddresses(ea);            if (oldHop.size() > 0) // we still have some endpoint addresses                replaceHop(oldHop);            else                removeHop(pid);        }    }        /**     * Return hop of the route at location index in the hops list     *     * @param index in the list of hops     * @return hop AccessPointAdvertisement of the hops     */    public AccessPointAdvertisement getHop(int index) {                if (index < 0)            return null;                if (index > hops.size() - 1)            return null;                return (AccessPointAdvertisement) ((AccessPointAdvertisement)hops.elementAt(index)).clone();    }        /**     * construct a new route     * <p/><b>WARNING hops may be MODIFIED.</b>     **/    public static RouteAdvertisement newRoute(PeerID destPid,    PeerID firsthop,    Vector hops) {                RouteAdvertisement route = (RouteAdvertisement)        AdvertisementFactory.newAdvertisement(        RouteAdvertisement.getAdvertisementType());                // set the route destination        AccessPointAdvertisement ap = (AccessPointAdvertisement)        AdvertisementFactory.newAdvertisement(        AccessPointAdvertisement.getAdvertisementType());                if (destPid == null)            return null; // messed up destination        ap.setPeerID(destPid);        route.setDest(ap);                // set the route hops        for (Enumeration e = hops.elements(); e.hasMoreElements();) {            ap = (AccessPointAdvertisement) e.nextElement();            if (ap.getPeerID() == null)                return null; // bad route        }        route.setHops(hops);                // check if the given first hop is already in the route if not add it        // (note: we do not expect it to be there, but it is acceptable).        if (firsthop != null) {            ap = route.getFirstHop();            if (ap == null || ! ap.getPeerID().equals(firsthop)) {                ap = (AccessPointAdvertisement)                AdvertisementFactory.newAdvertisement(                AccessPointAdvertisement.getAdvertisementType());                ap.setPeerID(firsthop);                route.setFirstHop(ap);            }        }                return route;    }        /**     * construct a new route, all hops are in the hops parameter.     **/    public static RouteAdvertisement newRoute(PeerID destPid, Vector hops) {        return newRoute(destPid, null, hops);    }        /**     * Alter the given newRoute (which does not start from here) by using firstLeg, a known route to whence     * it starts from. So that the complete route goes from here to the end-destination via firstLeg.     * public static boolean stichRoute(RouteAdvertisement newRoute,     **/    public static boolean stichRoute(RouteAdvertisement newRoute, RouteAdvertisement firstLeg) {        return stichRoute(newRoute, firstLeg, null);    }        /**     * Alter the given newRoute (which does not start from here) by using firstLeg, a known route to whence     ** it starts from. So that the complete route goes from here to the end-destination via firstLeg     **  also shortcut the route by removing the local peer     **/    public static boolean stichRoute(RouteAdvertisement newRoute,    RouteAdvertisement firstLeg,    PeerID localPeer) {                if ( newRoute.hasALoop() )            return false;                Vector hops = newRoute.getVectorHops();                // Make room        hops.ensureCapacity(firstLeg.getVectorHops().size() + 1 + hops.size());                // prepend the routing peer unless the routing peer happens to be        // in the route already. That happens if the routing peer is the relay.        // or if the route does not have a first leg        PeerID routerPid = firstLeg.getDest().getPeerID();        if (newRoute.size() == 0 || (! newRoute.getFirstHop().getPeerID().equals(routerPid))) {            AccessPointAdvertisement ap = (AccessPointAdvertisement)            AdvertisementFactory.newAdvertisement(            AccessPointAdvertisement.getAdvertisementType());            // prepend the route with the routing peer.            ap.setPeerID(routerPid);            hops.add(0, ap);        }                // prepend the rest of the route        hops.addAll(0, firstLeg.getVectorHops());                // remove any llop from the root        cleanupLoop(newRoute, localPeer);        return true;    }        /**     * Remove loops from the route advertisement     * by shortcuting cycle from the route     **/    public static void cleanupLoop(RouteAdvertisement route, PeerID localPeer) {                // Note: we cleanup all enp addresses except for the last hop (which        // we use to shorten routes often enough).        // If we end-up removing the last hop, it means that it is the        // local peer and thus the route ends up with a size 0.                Vector hops = route.getVectorHops();        Vector newHops = new Vector(hops.size());        Object lastHop = null;                // Replace all by PID-only entries, but keep the last hop on the side.        if (hops.size() > 0) {            lastHop = hops.elementAt(hops.size() - 1);        }        hops = ((RouteAdvertisement) route.cloneOnlyPIDs()).getVectorHops();                // remove cycle from the route        for (int i=0; i < hops.size(); i++) {            int loopAt = newHops.indexOf(hops.elementAt(i));            if (loopAt != -1) { // we found a cycle                                // remove all entries after loopAt                for (int j = newHops.size(); --j > loopAt;) {                    newHops.remove(j);                }            } else { // did not find it so we add it                newHops.add(hops.elementAt(i));            }        }                // Remove the local peer in the route if we were given one        if (localPeer != null) {            for (int i = newHops.size(); --i >= 0;) {                if (localPeer.equals(((AccessPointAdvertisement)                newHops.elementAt(i)).getPeerID())) {                    // remove all the entries up to that point we                    // need to keep the remaining of the route from that                    // point                    for (int j = 0; j <= i; j++) {                        newHops.remove(0);                    }                    break;                }            }        }                if (lastHop != null && newHops.size() > 0) {            newHops.setElementAt(lastHop, newHops.size() - 1);        }                // update the new hops in the route        route.setHops(newHops);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
懂色av中文一区二区三区| 麻豆精品久久精品色综合| 国产精品久久久久影院亚瑟| 26uuu国产电影一区二区| 精品国产在天天线2019| 26uuu国产在线精品一区二区| 亚洲精品在线观看视频| 久久久久国产精品麻豆ai换脸 | 国产精品色在线| 亚洲精品成人精品456| 久久99在线观看| 欧美日韩激情在线| 91麻豆蜜桃一区二区三区| 91福利精品第一导航| 91精品国产综合久久久蜜臀图片| 日韩一区二区三区观看| 国产精品女人毛片| 奇米四色…亚洲| eeuss鲁一区二区三区| 欧美群妇大交群中文字幕| 91精品国产免费久久综合| 国产无一区二区| 日韩av成人高清| 日本高清无吗v一区| 国产网红主播福利一区二区| 一区二区在线观看不卡| 国产尤物一区二区| 欧美一区二区三区影视| 日韩理论片中文av| 北条麻妃国产九九精品视频| 日韩精品在线看片z| 亚洲美女偷拍久久| 成人黄色免费短视频| 精品88久久久久88久久久| 日韩极品在线观看| 欧洲视频一区二区| 亚洲乱码国产乱码精品精的特点 | 欧美在线你懂的| 中文字幕乱码亚洲精品一区| 国产激情偷乱视频一区二区三区| 91精品在线一区二区| 亚洲成人免费看| 欧美三级电影在线看| 亚洲国产精品久久久男人的天堂 | 亚洲自拍偷拍麻豆| 在线看日本不卡| 天堂精品中文字幕在线| 91精品国产综合久久精品麻豆| 图片区小说区区亚洲影院| 欧美一区二区精美| 国产成人免费av在线| 欧美激情综合五月色丁香| 99国产精品视频免费观看| 一区二区高清在线| 日韩欧美国产三级电影视频| 久久99精品国产.久久久久| 国产日韩精品一区| 欧美高清一级片在线| 国内国产精品久久| 亚洲一区二区三区免费视频| 精品国产乱码久久久久久图片 | 中文字幕一区二区三| 欧美熟乱第一页| 国产精品中文有码| 一区二区三区高清| 中文字幕免费在线观看视频一区| 99re视频这里只有精品| 琪琪久久久久日韩精品| 国产精品精品国产色婷婷| 日韩一级欧美一级| 欧美性生交片4| av中文字幕一区| 国产精品88av| 韩国精品主播一区二区在线观看| 成人欧美一区二区三区小说 | 国产成人99久久亚洲综合精品| 日韩精品一区二区三区蜜臀| 日韩中文字幕91| 亚洲精品一区在线观看| 91精品国产手机| 制服.丝袜.亚洲.另类.中文| 色婷婷亚洲综合| 欧美亚日韩国产aⅴ精品中极品| 成人免费高清在线观看| 成人污视频在线观看| 精品一区二区三区不卡| 久久99精品国产麻豆婷婷洗澡| 午夜精品国产更新| 免费av网站大全久久| 五月综合激情婷婷六月色窝| 天堂在线亚洲视频| 久久在线观看免费| 岛国一区二区三区| 91蜜桃视频在线| 欧美色大人视频| 91精品综合久久久久久| 91精品国产入口| 日韩欧美综合一区| 久久婷婷久久一区二区三区| 久久伊人蜜桃av一区二区| 久久精品视频一区二区三区| 国产精品久久夜| 亚洲国产精品自拍| 国产精品 欧美精品| 欧美视频中文字幕| 国产午夜亚洲精品理论片色戒| 欧美日本在线视频| 精品免费视频一区二区| 亚洲婷婷综合久久一本伊一区| 日日欢夜夜爽一区| 美腿丝袜亚洲三区| 色偷偷久久人人79超碰人人澡| 日韩精品一区二区三区swag| 日本一区二区三区在线不卡| 秋霞电影一区二区| 不卡电影免费在线播放一区| 欧美一区二区三区四区五区 | 亚洲国产日日夜夜| 成人免费av在线| 中文字幕第一区综合| 精品一区免费av| 欧美一级欧美三级在线观看| 亚洲影院理伦片| 91福利国产精品| 日本精品裸体写真集在线观看| 欧美tickle裸体挠脚心vk| av高清久久久| 91精品国产入口| 亚洲成a人片在线不卡一二三区 | 精品国产露脸精彩对白| 亚洲午夜久久久久中文字幕久| 欧美国产日韩一二三区| 国产在线国偷精品免费看| 91精品视频网| 日韩电影一区二区三区四区| 欧美日韩一区三区| 丝袜美腿成人在线| 欧美va天堂va视频va在线| 久久国产尿小便嘘嘘尿| 国产亚洲自拍一区| 亚洲大片精品永久免费| 7777精品伊人久久久大香线蕉完整版 | 久久噜噜亚洲综合| 成人午夜视频在线| 亚洲精品国产a久久久久久| 777午夜精品视频在线播放| 紧缚奴在线一区二区三区| 欧美高清在线一区二区| 欧美日韩亚洲综合| 国产一区欧美一区| 亚洲国产精品国自产拍av| 欧美日韩精品二区第二页| 国产一区二区精品在线观看| 亚洲一区欧美一区| 国产三级一区二区| 欧美一区二区三区免费视频| 国产精品一区二区三区99| 亚洲第一av色| 亚洲欧美日韩一区二区三区在线观看| 欧美日韩精品免费观看视频| 成人h动漫精品一区二区| 美女一区二区久久| 亚洲高清在线精品| 亚洲人成网站色在线观看| 久久久久青草大香线综合精品| 欧美日韩不卡一区二区| 色婷婷香蕉在线一区二区| www.久久精品| 丁香网亚洲国际| 丰满亚洲少妇av| 黄色日韩三级电影| 国产一区二区三区四区五区入口| 日韩成人精品视频| 蜜臀a∨国产成人精品| 美女一区二区三区| 久久se精品一区二区| 国产综合色产在线精品| 国产精品中文字幕日韩精品| 国产一区二区三区在线观看免费 | 伊人性伊人情综合网| 日韩美女视频一区| 亚洲欧美欧美一区二区三区| 亚洲丝袜精品丝袜在线| 亚洲人成网站色在线观看| 亚洲日本丝袜连裤袜办公室| 亚洲黄色尤物视频| 亚洲一区二区中文在线| 午夜精品免费在线| 日韩电影在线看| 成人精品视频一区| 色综合天天综合网天天狠天天| 欧美群妇大交群的观看方式| 精品久久99ma| 亚洲少妇中出一区| 免费欧美在线视频| 麻豆91精品视频| 狠狠色狠狠色综合系列| 91在线免费看| 欧美精品一区男女天堂| 国产精品毛片高清在线完整版|