final String OWNER = "Kubota";
Vehicle[] vehicles = new Vehicle[VEHICLE_NUM];
for(int i = 0; i < vehicles.length; i++) {
vehicles[i] = new Vehicle();
vehicles[i].setOwner(OWNER);
vehicles[i].setSpeed(Math.random() * i);
vehicles[i].setDirection(Math.random() * i);
}
LinkedList startNode = new LinkedList(vehicles[0]);
LinkedList node = startNode;
for(int i = 1; i < vehicles.length; i++) {
node.setNext(new LinkedList(vehicles[i]));
node = node.next;
}
node = startNode;
while(node != null) {
Vehicle output = (Vehicle)node.getValue();
System.out.println("ID : " + output.getId());
System.out.println("OWNER : " + output.getOwner());
System.out.println("SPEED : " + output.getSpeed());
System.out.println("DIRECTION : " + output.getDirection());
System.out.println();
node = node.next;
}