package nloc; public class Droplet { private Position position; private DropletType type; public Droplet(DropletType type, Position position) { this.position = position; this.type = type; } public void move() { position.increment(this); } public DropletType getType() { return type; } public Position getPosition() { return position; } public void setPosition(Position position) { this.position.getChannel().removeDroplet(this); this.position = position; this.position.getChannel().addDroplet(this); } public boolean isInSink() { return this.position.getChannel() instanceof Sink; } }