Hello,
I wont post the whole program because it is a lot of classes, interfaces and abstract classes.
I am trying to filter a array by simply getting a value which is Z. The String representation of the whole application is
1,1,1:3,4,2:RoomA
x,y,z h,w,l name
The z parameter is suppose to filter through and only allow any Array above z > 1. It then returns the filter array.
I have done something similer but returns the full arraylist by coverting a array.
public static ArrayList<Room> rooms = new ArrayList<Room>(); public class Storey implements Buildable{ public static Room[] getAllRooms() { Room[] array = new Room[rooms.size()]; array = rooms.toArray(array); return array = rooms.toArray(array); } }
The below code needs to filter it by making anything above Z then returning it.
public class engine implements model { public Room[] getStoreyRooms(int storey) { //storey = RoomReference.getZ(); Room[] array = new Room[Storey.rooms.size()]; // array = Storey.rooms.toArray(array); array.equals(storey!=1); { // if storey.getLocation() return Storey.rooms.toArray(array); } }
This is the class it gets it from.
public class RoomReference { private int x; private int y; private int z; private AbstractRoom abstractRoom ; public RoomReference(int x, int y, int z) { this.abstractRoom = abstractRoom; this.x = x; this.y = y; this.z = z; } public int getX() { return x; } public int getY() { return y; } public int getZ() { return z; } public String toString() { String s = ""; s += x; s += ","; s += y; s += ","; s += z; s += ":"; return s; } }
I hope this is enough , but if you need me to post more please dont hesitate to ask.