    001    package ttsolver.model;
    002
    003    /**
    004     * Room part of placement.
    005     * <br><br>
    006     *
    007     * @author <a href="mailto:muller@ktiml.mff.cuni.cz">Tomáš Müller</a>
    008     * @version 1.0
    009     */
    010
    011    public class RoomLocation {
    012        private int iPreference;
    013        private String iName;
    014        private String iId;
    015        private String iBldgId;
    016        private long iRoomSize;
    017        private long iPosX = 0, iPosY = 0;
    018
    019        /** Constructor
    020         * @param id room id
    021         * @param name room name
    022         * @param bldgId building id
    023         * @param preference soft preference
    024         * @param size room size
    025         * @param x x-position of the building
    026         * @param y y-position of the building
    027         */
    028        public RoomLocation(String id, String name, String bldgId, int preference, long size, long x, long y) {
    029            iId = id;
    030            iName = name;
    031            iPreference = preference;
    032            iRoomSize = size;
    033            iPosX = x; iPosY = y;
    034            iBldgId = bldgId;
    035        }
    036
    037        /** Constructor
    038         * @param id room id
    039         * @param name room name
    040         * @param bldgId building id
    041         * @param preference soft preference
    042         * @param size room size
    043         */
    044        public RoomLocation(String id, String name, String bldgId, int preference, long size) {
    045            this(id, name, bldgId, preference, size, 0L, 0L);
    046        }
    047
    048        /** Room id */
    049        public String getId() { return iId; }
    050        /** Building id */
    051        public String getBuildingId() { return iBldgId; }
    052        /** Room name */
    053        public String getName() { return iName; }
    054        /** Room preference */
    055        public int getPreference() { return iPreference; }
    056        /** Room size */
    057        public long getRoomSize() { return iRoomSize; }
    058        /** Position of the building */
    059        public void setCoordinates(long x, long y) { iPosX=x; iPosY=y; }
    060        /** X-position of the building */
    061        public long getPosX() { return iPosX; }
    062        /** Y-position of the building */
    063        public long getPosY() { return iPosY; }
    064
    065        public String toString() {
    066            return "Room{name="+iName+", pref="+iPreference+"}";
    067        }
    068    }