For #2, you could check if the slope between any point and one point on the wall/line you want, is the same as the slope between two points on the line.
private boolean onWall(double x, double y, double wallX1, double wallY1, double wallX2, double wallY2) {
return (wallY1 - y) / (wallX1 - x) == (wallY2 - wallY1) / (wallX2 / wallX1);
}
So, the slopes calculated share a point, so if they're the same, they're all on the same line.