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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? sortedtopiclist.java

?? 一樂LIST 能夠返回你的Topic值
?? JAVA
字號(hào):
/* * /home/grant/Teaching/COMP213/New/Slides/Code/SortedTopicList.java * * Created: Tue Oct  7 15:09:21 2008 * * copyright Grant Malcolm * *   This source code may be freely used, modified, or distributed *   provided due credit is given. * * Version 1.1 fixes a bug in remove(int). */// package Comp213.MessageBoard.V1;/** * List of topics for a simple Message Board server. * This class represents a list of {@link Topic Topics} that might * be stored by a Message Board server.  Topics are stored in the order * of their most-recent update; the most-recently updated topics being * at the start of the list.  Topics are {@link #addNewTopic(Message) created} * by providing a {@link Message Message} to initiate the topic; * the topic is given a unique identifier (the length of the list), * and stored at the start of the list. * Topics may be updated by {@link #addMsgToTopic(Message,int) adding} * a message to a given topic * (specified by its {@link Topic#getID() identifier}); * the updated topic is moved to the start of the list. * * * @author <a href="mailto:grant@liverpool.ac.uk">Grant Malcolm</a> * @version 1.1 */public class SortedTopicList {    /**     * The number of topics in the list.     *     */    private int length = 0;    /**     * A linked list of {@link Topic Topics}.     *     */    private TopicList topics = null;    /**     * Creates a new <code>SortedTopicList</code> instance.     * The new instance has an empty list of topics.     *     */    public SortedTopicList()    {        // do nothing; topics is null, which is the empty list    }    /**     * The length of the list; i.e., the number of {@link Topic topics}     * in the list.     *     * @return the number of topics in the list     */    public int getLength()    {        return length;    }    /**     * Add a new Topic to the list.  The {@link Topic Topic} contains     * the given {@link Message message}, and is assigned a unique identifier     * (the {@link #getLength() length} of the list).  The new topic is     * placed at thestart of the list.     *     * @param m the first message in the topic     */    public void addNewTopic(Message m)    {        // the new topic to add to the start of the list        Topic t = new Topic(length, m);        if (length == 0)        {  // list was empty; start a new list:           topics = new TopicList(t);        }        else        {  // add to start of list           topics = new TopicList(t,topics);        }        // list is one topic longer        length++;    }    /**     * Add a message to a topic.  The given {@link Message message} will be     * added to the {@link Topic topic} with the given ID;     * this topic will be moved to the start of the list,     * as it is the most-recently updated.     * If there is no topic in the list with the given ID,     * this method has no effect.     *     * @param m the message to be added     * @param i the id of the topic to add the message to     */    public void addMsgToTopic(Message m, int i)    {        /*         * We could do this with         *         *   Topic t = getTopic(i);         *   removeTopic(i);         *   t.addMessage(m);         *   add(t);         *         * But getTopic() and removeTopic() both loop through the list         * in a similar way; the following code combines these loops into         * one loop that has the same effect as the code above,         * but is more efficient.         *         */        // if list is empty, do nothing        if (topics == null)        {           return;        }        /*         *  else:         *  if the first element has the requested id, add the message         */        if (topics.head().getID() == i)        {           topics.head().addMsg(m);           return;        }        /*         *  else:         *  (the list is not empty and the first topic is not the one we want):         *  traverse through the list to find the topic with ID i         */        TopicList tl = topics.next();  // the next topic to look at        TopicList tlPrev = topics;  // the previous node; when we find the                                   // node to remove, we'll set the next                                  // field of this node to the node                                 // after tl        Topic ti;  // will hold the topic of the current node        while (tl != null) // stop at end of list        {           ti = tl.head();  // the topic at the current node           if (ti.getID() == i)           {              /*               * found topic with ID i:               * add the message and move to start of list               *               */              ti.addMsg(m);              /*               * remove tl from list:               */              // tlPrev should point to node after tl (can be null):              tlPrev.next = tl.next();              // tl should be first;              // it should point to what was the start of the list              tl.next = topics;              // start of the list should be tl              topics = tl;              return;  // done           }           // else (haven't found the topic): move on to tail of list           tlPrev = tl;           tl = tl.next();        }        // got through without finding i: do nothing    }    /**     * Put a topic at the start of the list.     *     * @param t the topic to be placed at the start of the list     */    private void add(Topic t)    {        topics = new TopicList(t,topics);    }    /**     * Get the topic with the given ID.  This method is only required     * for paedogogic reasons; the code that implements this method is     * incorporated in the implementation of     * {@link #addMsgToTopic addMsgToTopic}.     *     * @param id the ID of the topic to find     * @return the topic with the given ID     */    public Topic getTopic(int id)    {        // traverse through this copy of the list        TopicList tl = topics;        // stop when found, or at end of list        while (tl != null)        {           if (tl.head().getID() == id)           {              return tl.head();           }           tl = tl.next();        }        return null;    }    /**     * Remove the topic with the given ID.  This method is only required     * for paedogogic reasons; the code that implements this method is     * incorporated in the implementation of     * {@link #addMsgToTopic addMsgToTopic}.     *     * @param id the ID of the topic to remove     */    public void removeTopic(int id)    {        // if list is empty, do nothing        if (length == 0) return;        // if the first element has the requested id, remove it        if (topics.head().getID() == id)        {            /*             * remove it by setting the pointer to the start of the list             * to the next node             */             topics = topics.next();             return;        }        /*         *  else:         *  (the list is not empty and the first topic is not the one we want):         *  traverse through the list to find the topic with ID i         */        TopicList tl = topics.next();  // the next topic to look at        TopicList tlPrev = topics;  // the previous node; when we find the                                   // node to remove, we'll set the next                                  // field of this node to the node                                 // after tl        Topic ti;  // will hold the topic of the current node        while (tl != null) // stop at end of list        {           ti = tl.head();  // the topic at the current node           if (ti.getID() == id)           {              /*               * found topic with ID i: remove it               *               */              // tlPrev should point to node after tl (can be null):              tlPrev.next = tl.next();              // tl should be first;              // it should point to what was the start of the list              tl.next = topics;              // start of the list should be tl              topics = tl;              return;  // done           }           // else: (haven't found the topic) move on to tail of list           tlPrev = tl;           tl = tl.next();        }        // got through without finding i: do nothing    }    /**     * A linked list of Topics.     *     * @author <a href="mailto:grant@liverpool.ac.uk">Grant Malcolm</a>     * @version 1.0     */    class TopicList    {        /**         * The topic at the start of the list.         *         */        private Topic head = null;        /**         * pointer to the tail of the list.         *         */        private TopicList next = null;        /**         * Creates a new <code>TopicList</code> instance with the given Topic.         *         * @param n the topic to store at the current node         */        TopicList(Topic n)        {            head = n;        }        /**         * Creates a new <code>TopicList</code> instance with the given head         * and tail.         *         * @param n the topic to store         * @param l the tail of the list         */        TopicList(Topic n, TopicList l)        {            head = n;            next = l;        }        /**         * Get the topic at the current node.         *         * @return the topic at the current node         */        public Topic head()        {            return head;        }        /**         * Get the tail of the list.         *         * @return the next node.         */        public TopicList next()        {            return next;        }    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品成人一区二区三区夜夜夜| 国产精品网站导航| 国产成人av影院| 亚洲午夜激情网站| 久久天堂av综合合色蜜桃网| 色综合久久天天综合网| 国产一二精品视频| 亚洲午夜久久久久久久久电影院| 欧美激情综合五月色丁香 | 国产精品一区二区久久不卡 | 中文字幕电影一区| 欧美成人国产一区二区| 欧美影院午夜播放| www.av精品| 国产福利精品一区| 久久精品二区亚洲w码| 亚洲精品网站在线观看| 国产欧美va欧美不卡在线| 日韩女优毛片在线| 欧美日韩国产123区| 日本伦理一区二区| 99精品国产99久久久久久白柏| 国产美女精品一区二区三区| 蜜桃在线一区二区三区| 亚洲大片一区二区三区| 亚洲一区二区综合| 亚洲精品乱码久久久久| 日韩一区欧美一区| 国产精品高潮久久久久无| 日本一二三不卡| 国产精品天干天干在线综合| 久久久亚洲精品石原莉奈| 亚洲精品一区二区三区福利| 欧美一区二区三区四区久久| 欧美精品在线观看一区二区| 欧美丝袜第三区| 欧美性色黄大片手机版| 欧美色偷偷大香| 欧美色图天堂网| 欧美日韩激情在线| 在线不卡a资源高清| 69堂国产成人免费视频| 91精品国产综合久久久久| 欧美丰满少妇xxxbbb| 制服丝袜亚洲精品中文字幕| 3751色影院一区二区三区| 69堂精品视频| 欧美精品一区二区精品网| 久久综合av免费| 欧美激情一区二区三区蜜桃视频| 中文久久乱码一区二区| 亚洲欧美国产77777| 有坂深雪av一区二区精品| 亚洲v日本v欧美v久久精品| 婷婷久久综合九色综合绿巨人| 日韩成人精品视频| 国产一区二区三区日韩| 成人免费毛片app| 在线看一区二区| 欧美精品视频www在线观看| 日韩区在线观看| 久久久www成人免费毛片麻豆| 中文字幕av一区 二区| 亚洲人成网站影音先锋播放| 亚洲在线中文字幕| 美女视频黄频大全不卡视频在线播放| 国产一区二区三区视频在线播放| 成人18精品视频| 欧美日韩精品电影| 久久久久国产精品麻豆| 亚洲精品成人悠悠色影视| 日韩不卡一区二区| 成人午夜激情在线| 欧美老年两性高潮| 中文天堂在线一区| 日一区二区三区| 国产成人精品免费| 欧美日韩国产另类一区| 欧美激情综合五月色丁香小说| 亚洲精品免费在线| 九九视频精品免费| 91丨九色porny丨蝌蚪| 日韩午夜电影av| 亚洲啪啪综合av一区二区三区| 琪琪一区二区三区| av一区二区三区| 精品日韩在线一区| 一区二区三区在线免费播放| 九色porny丨国产精品| 色嗨嗨av一区二区三区| 26uuu精品一区二区在线观看| 亚洲免费观看高清完整版在线观看 | 欧美一级免费大片| 国产精品黄色在线观看| 久久精品国产一区二区三| 色综合久久88色综合天天6 | 欧美高清视频一二三区 | 久久亚洲捆绑美女| 亚洲国产中文字幕在线视频综合| 国产一区二区免费看| 在线播放91灌醉迷j高跟美女| 国产精品青草久久| 国模一区二区三区白浆| 3d动漫精品啪啪一区二区竹菊| 国产精品灌醉下药二区| 国产在线精品免费| 日韩一区二区三区高清免费看看| 综合欧美亚洲日本| 成人国产精品免费| 亚洲精品一区在线观看| 五月天欧美精品| 一本大道久久a久久精二百| 日本一二三不卡| 国产精品一品视频| 日韩三级在线观看| 午夜精品爽啪视频| 日本韩国欧美一区| 国产精品美女一区二区在线观看| 国产综合色在线| 26uuu另类欧美| 久久成人久久鬼色| 欧美一区二区三区婷婷月色 | 日产欧产美韩系列久久99| 在线看日本不卡| 一区2区3区在线看| 91猫先生在线| 亚洲精品国产成人久久av盗摄| 色综合天天做天天爱| 亚洲啪啪综合av一区二区三区| 不卡视频免费播放| 亚洲日本免费电影| 91精品91久久久中77777| 亚洲精品国产第一综合99久久| 91免费观看视频在线| 亚洲欧美日韩国产一区二区三区| 99国产欧美另类久久久精品| 亚洲男人天堂av| 在线观看亚洲精品| 亚洲成人综合视频| 欧美一区二区在线播放| 免费美女久久99| 久久毛片高清国产| 粉嫩av亚洲一区二区图片| 中文字幕成人网| 91免费观看国产| 亚洲电影一级黄| 欧美一级电影网站| 国产精品一级片在线观看| 久久久久久久久久电影| 成人精品一区二区三区中文字幕| 国产精品久99| 欧美日韩视频在线第一区| 婷婷一区二区三区| 欧美tickle裸体挠脚心vk| 国产成人啪午夜精品网站男同| 国产精品第一页第二页第三页| 9i在线看片成人免费| 亚洲国产另类av| 精品国产在天天线2019| 国产99精品国产| 一区二区三区鲁丝不卡| 日韩一区二区麻豆国产| 国产**成人网毛片九色| 一区二区三区四区精品在线视频 | 亚洲欧洲成人自拍| 色综合视频在线观看| 日韩av在线发布| 欧美国产日韩一二三区| 色婷婷激情一区二区三区| 免费观看日韩av| 自拍视频在线观看一区二区| 欧美午夜宅男影院| 国产一区免费电影| 一区二区三区在线观看国产| 欧美va日韩va| 欧洲精品中文字幕| 国产真实乱对白精彩久久| 亚洲三级在线观看| 26uuu亚洲| 欧美午夜免费电影| 国产aⅴ综合色| 日本成人中文字幕| 亚洲欧美激情插| 久久久久久久久久久久久久久99| 在线视频欧美区| 国产成人在线看| 午夜精品久久久久久久久| 中文字幕欧美国产| 91精品一区二区三区久久久久久| www.综合网.com| 国产一区欧美一区| 视频一区二区中文字幕| 国产精品乱人伦中文| 欧美成人伊人久久综合网| 91传媒视频在线播放| 成人黄色在线视频| 极品少妇一区二区| 婷婷激情综合网| 亚洲欧美另类小说| 国产欧美综合在线|