All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lejos.robotics.pathfinding.Path Maven / Gradle / Ivy

Go to download

leJOS (pronounced like the Spanish word "lejos" for "far") is a tiny Java Virtual Machine. In 2013 it was ported to the LEGO EV3 brick.

The newest version!
package lejos.robotics.pathfinding;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import lejos.robotics.Transmittable;
import lejos.robotics.navigation.Waypoint;

/**
 * Represents a path consisting of an ordered collection of waypoints
 * 
 * @author Lawrie Griffiths
 *
 */
public class Path extends ArrayList implements Transmittable {

	public void dumpObject(DataOutputStream dos) throws IOException {
		dos.writeInt(this.size());
		for(Waypoint wp: this) {
			wp.dumpObject(dos);
		}
	}

	public void loadObject(DataInputStream dis) throws IOException {
		int n = dis.readInt();
		this.clear();
		for(int i=0;i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy