Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/toolkit/components/remote/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 3 kB image not shown  

Quelle  Bus.java

  Sprache: JAVA
 

package gui;

import java.awt.Point;
import java.util.LinkedList;
import java.util.List;

public class Bus {

 int passCount;
 int id;
 Point currentPoint;
 List<Point> currentRoute;
 int currentRouteIndex;
 int currentRouteStepSize;
 
 Bus(int busline, Point initialPoint){
  id = busline;
  passCount = 0;
  currentRoute = new LinkedList<Point>();
  currentRouteIndex = 0;
  currentRouteStepSize = 0;
  currentPoint = initialPoint;
 }
 
 public synchronized void  setPassengerCount(int passengerCount){
  passCount = passengerCount;
 }
 
 public synchronized int passengerCount() {
  return passCount;
 }
 
 public int lineNr(){
  return id;
 }
 
 public synchronized void move(){
  
  if(currentRouteIndex + currentRouteStepSize < currentRoute.size())
  {
   currentRouteIndex += currentRouteStepSize;
   currentPoint = currentRoute.get((currentRouteIndex));
  }
 }
 
 public synchronized void busArrived(){
  
  currentRouteIndex = currentRoute.size();
  currentPoint = currentRoute.get(currentRoute.size() -1);
 }
 
 public synchronized void setRoute(List<Point> route, int timeToMove)
 {
  currentRoute = route;
  currentRouteIndex = 0;

  currentRouteStepSize =  (int) Math.floor(route.size() / timeToMove);
 }
 
 public synchronized Point  getBusPosition(){
  
  return currentPoint;
 }
 
}

Messung V0.5 in Prozent
C=94 H=92 G=92

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-06-17) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.