打字猴:1.700459129e+09
1700459129
1700459130 protected abstract void stop();
1700459131
1700459132 //喇叭会出声音,是滴滴叫,还是哔哔叫
1700459133
1700459134 protected abstract void alarm();
1700459135
1700459136 //引擎会轰隆隆地响,不响那是假的
1700459137
1700459138 protected abstract void engineBoom();
1700459139
1700459140 //那模型应该会跑吧,别管是人推的,还是电力驱动,总之要会跑
1700459141
1700459142 final public void run(){
1700459143
1700459144 //循环一边,谁在前,就先执行谁
1700459145
1700459146 for(int i=0;i<this.sequence.size();i++){
1700459147
1700459148 String actionName=this.sequence.get(i);
1700459149
1700459150 if(actionName.equalsIgnoreCase(“start”)){
1700459151
1700459152 this.start();//开启汽车
1700459153
1700459154 }else if(actionName.equalsIgnoreCase(“stop”)){
1700459155
1700459156 this.stop();//停止汽车
1700459157
1700459158 }else if(actionName.equalsIgnoreCase(“alarm”)){
1700459159
1700459160 this.alarm();//喇叭开始叫了
1700459161
1700459162 }else if(actionName.equalsIgnoreCase(“engine boom”)){//
1700459163
1700459164 如果是engine boom关键字
1700459165
1700459166 this.engineBoom();//引擎开始轰鸣
1700459167
1700459168 }
1700459169
1700459170 }
1700459171
1700459172 }
1700459173
1700459174 //把传递过来的值传递到类内
1700459175
1700459176 final public void setSequence(ArrayList<String>sequence){
1700459177
1700459178 this.sequence=sequence;
[ 上一页 ]  [ :1.700459129e+09 ]  [ 下一页 ]