ProgrammierMethodik 2002 - RoboCup

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

RCObject.java

Go to the documentation of this file.
00001 /*
00002  * $Id: RCObject_8java-source.html,v 1.2 2002/07/07 20:59:52 stork Exp $
00003  *
00004  * $Log: RCObject_8java-source.html,v $
00004  * Revision 1.2  2002/07/07 20:59:52  stork
00004  * update dokumenation
00004  *
00005  * Revision 1.4  2002/06/27 20:26:39  stork
00006  * add + update dokumentation
00007  *
00008  * Revision 1.3  2002/06/08 14:40:02  stork
00009  * exception error fixed
00010  *
00011  * Revision 1.2  2002/05/29 15:17:48  stork
00012  * implement object
00013  *
00014  * Revision 1.1.1.1  2002/05/21 20:32:05  stork
00015  * empty project
00016  *
00017  */
00018 import java.util.*;
00019 
00020 
00024 public class RCObject {
00026     public LinkedList XList;
00027     public LinkedList YList;
00028     public LinkedList TimeList;
00029     public int HistoryLength;
00030 
00034     public RCObject(){
00035         /* init */
00036         XList = new LinkedList();
00037         YList = new LinkedList();
00038         TimeList = new LinkedList();
00039 
00040         HistoryLength = 3;
00041     }
00042 
00043 
00050     public double X ( int History ){
00051         double retVal = 0;
00052         try{
00053             retVal = ((Double)(XList.get(History))).doubleValue();
00054         }catch(Exception e){
00055             retVal = 0;
00056         }
00057         return retVal;
00058     }
00059 
00066     public double Y ( int History ){
00067         double retVal = 0;
00068         try{
00069             retVal = ((Double)(YList.get(History))).doubleValue();
00070         }catch(Exception e){
00071             retVal = 0;
00072         }
00073         return retVal;
00074     }
00075 
00082     public int Time ( int History ){
00083         int retVal = 0;
00084         try{
00085             retVal = ((Integer)(TimeList.get(History))).intValue();
00086         }catch(Exception e){
00087             retVal = 0;
00088         }
00089         return retVal;
00090     }
00091 
00097     public void insertX ( double Value ){
00098         XList.addFirst(new Double(Value));
00099         if( XList.size() > HistoryLength )
00100             XList.removeLast();
00101     }
00102 
00108     public void insertY ( double Value ){
00109         YList.addFirst(new Double(Value));
00110         if( YList.size() > HistoryLength )
00111             YList.removeLast();
00112     }
00113 
00119     public void insertTime ( int Time ){
00120         TimeList.addFirst(new Integer(Time));
00121         if( TimeList.size() > HistoryLength )
00122             TimeList.removeLast();
00123     }
00124 }
00125 

(c) Copyright by Gruppe 1 :
  • Frederik Transier
  • Motitz Ritter
  • Oliver Strassburger
  • Sven Stork