public void addForce(Force f){
  if (f.isItemForce()) {
    if (iforces.length == iflen) {
      Force[] newf=new Force[iflen + 10];
      System.arraycopy(iforces,0,newf,0,iforces.length);
      iforces=newf;
    }
    iforces[iflen++]=f;
  }
  if (f.isSpringForce()) {
    if (sforces.length == sflen) {
      Force[] newf=new Force[sflen + 10];
      System.arraycopy(sforces,0,newf,0,sforces.length);
      sforces=newf;
    }
    sforces[sflen++]=f;
  }
}

public void addForce ( Force f ) { if ( f . isItemForce ( ) ) { if ( iforces . length == iflen ) { Force [ ] newf = new Force [ iflen + 10 ] ; System . arraycopy ( iforces , 0 , newf , 0 , iforces . length ) ; iforces = newf ; } iforces [ iflen ++ ] = f ; } if ( f . isSpringForce ( ) ) { if ( sforces . length == sflen ) { Force [ ] newf = new Force [ sflen + 10 ] ; System . arraycopy ( sforces , 0 , newf , 0 , sforces . length ) ; sforces = newf ; } sforces [ sflen ++ ] = f ; } }
add a new force function to the simulator .
