华人德语培训中心     Fahrschule Rainer     
第2页,共2页 第一第一 1 2
显示结果从 11 到 15 共计 15 条
  1. #11
    高级会员 新生儿 星星点 的头像
    注册日期
    2007-01-30
    住址
    shan shang de
    文章
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts
    声望力
    19

    预设 回复: 请教java编程问题!紧急!!!

    package Test2;

    /*
    * Created on 2007-4-8
    *
    * TODO To change the template for this generated file go to
    * Window - Preferences - Java - Code Style - Code Templates
    */
    /**
    * @copyright
    *
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    */
    public class LinkedList {
    ListItem first;
    ListItem current;
    ListItem last;

    public LinkedList(){

    }

    public LinkedList(Person p){
    add(p);
    }

    public LinkedList(Person[] pA){

    for (int i = 0; i<pA.length; i++){
    add(pA[i]);
    }

    }

    public void add(Person newperson){
    ListItem newItem = new ListItem(newperson);//listitem consturctor;

    if (first==null){
    first = newItem;
    current = newItem;
    last = newItem;

    newItem.setPrev(null);
    newItem.setNext(null);
    } else {
    last.setNext(newItem);//找到最后一个点,last.next赋值,如同,*p指针的next指向newitem。
    newItem.setPrev(last);
    last = newItem;//链的最后一个元素为newitem;

    }
    }
    public boolean remove(Person person){
    boolean removeold=false;
    current=first;
    while(current!=last){

    if(current.item==person)
    {if(current == first) {
    first.getNext().setPrev(null);
    first = first.getNext();
    current = first;
    } else if (current == last){
    last.getPrev().setNext(null);
    last = last.getPrev();
    current = last;
    } else {
    current.getPrev().setNext(current.getNext());
    current.getNext().setPrev(current.getPrev());
    current = current.getNext();
    }
    removeold=true;break;


    }
    else {current=current.getNext();}
    }

    if(current==last&&current.item==person){
    removeold=true;
    if (last ==first){
    first = null;
    last = null;
    current = null;
    } else{
    last.getPrev().setNext(null);
    last = last.getPrev();
    current = last;
    } }
    return removeold;
    }
    public ListItem getFirst(){
    if (first!=null){
    current = first;
    return first;
    } else return null;
    }
    public ListItem getLast(){
    if (last!=null){
    current = last;
    return last;
    }
    else return null;
    }
    public ListItem getNext(){
    if (current.hasNext()){
    current = current.getNext();
    return current;
    } else
    return null;
    }
    public ListItem getPrev(){//yiqian de
    if (current.hasPrev()){
    current = current.getPrev();
    return current;
    } else
    return null;
    }

    public String toString(){
    String outString ="<TelephonVerzeichnis:>\n";
    ListItem nextItem = first;
    while (nextItem != null){
    outString += nextItem.toString()+"\n";
    nextItem = nextItem.getNext();
    }
    return outString + "</TelephonVerzeichnis:>\n";

    }
    }

  2. #12
    高级会员 新生儿 星星点 的头像
    注册日期
    2007-01-30
    住址
    shan shang de
    文章
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts
    声望力
    19

    预设 回复: 请教java编程问题!紧急!!!

    够哥们吧。。请客把

  3. #13
    TriVector
    游客

    预设 回复: 请教java编程问题!紧急!!!

    引用 作者: 星星点 查看文章
    CCNA kao de zen me yang le? wo zhi dao ni shi shui le.......zai code li bian ru zi ji de mingzi,ju shuo ni asp bu cuo, ni tong wu lai, jiu shi nage ai kan nü ren wo zui da de nage qing dao xiao di
    你下次回帖写德文或英文会不会更直接一些?。。。

  4. #14
    高级会员 新生儿 星星点 的头像
    注册日期
    2007-01-30
    住址
    shan shang de
    文章
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts
    声望力
    19

    预设 回复: 请教java编程问题!紧急!!!

    引用 作者: TriVector 查看文章
    你下次回帖写德文或英文会不会更直接一些?。。。
    所有那些会说中文的中国人跟自己的同胞说德文或英文,那些人都是欠抽的。(除了特殊情况下,像我现在如果跟你说德语或英语那我就是欠抽),。因为那些人在学习语言的过程中被别人不同程度的嘲笑或者批评过,现在他们语言好了之后然后再在后面那些语言不好的人再嘲笑回去。。。远远箱包和史料阿。。没劲阿。。不同的语言不过是动物的不同的发音而以,最原始的目的就是可以能互相交流。还能有什么阿哎。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

  5. #15
    TriVector
    游客

    预设 回复: 请教java编程问题!紧急!!!

    引用 作者: 星星点 查看文章
    所有那些会说中文的中国人跟自己的同胞说德文或英文,那些人都是欠抽的。(除了特殊情况下,像我现在如果跟你说德语或英语那我就是欠抽),。因为那些人在学习语言的过程中被别人不同程度的嘲笑或者批评过,现在他们语言好了之后然后再在后面那些语言不好的人再嘲笑回去。。。远远箱包和史料阿。。没劲阿。。不同的语言不过是动物的不同的发音而以,最原始的目的就是可以能互相交流。还能有什么阿哎。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
    .............简单方便就好...............

主题讯息

目前查看此主题的会员

目前有1位用户正在查看此主题。(0 位会员和 1 游客)

发文规则

  • 不可以发表新主题
  • 不可以发表回复
  • 不可以上传附件
  • 不可以编辑自己的文章
  •