|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectscheduler.db.locationdb.Location
public class Location
This class contains the place and informaton about a location.
Nested Class Summary | |
---|---|
class |
Location.InvalidDayOfWeekException
This exception class is thrown when the day of week is not in the Sunday to Saturday format. |
class |
Location.InvalidTimeInputException
This exception is raised when invalid time inputs are entered. |
private class |
Location.ProvidedEquipment
This class contains the equipment provided at a location. |
Field Summary | |
---|---|
private boolean |
adaCompliant
Whether this location is compliant to those with disabilities. |
private WeekAvail |
availability
Represents a location's availabilty throughout the week. |
private java.lang.String |
building
Building number of location. |
private int |
maxOccupancy
Maximum occupancy of this location. |
private Location.ProvidedEquipment |
providedEquipment
Provided equuipment in this location. |
private java.lang.String |
room
Room number of location. |
static Location |
TBA
Represents a location who's identity is not yet known |
private java.lang.String |
type
Type of this location. |
Constructor Summary | |
---|---|
Location(int bldg,
int room)
This constructor creates a location at a particular room and building. |
|
Location(Location l)
Creates a location which is a copy of a given location. |
|
Location(java.lang.String building,
java.lang.String room)
This constructor will make a location at a building and room number. |
|
Location(java.lang.String building,
java.lang.String room,
int maxOccupancy,
java.lang.String type,
boolean disabilities,
boolean smartroom,
boolean laptop,
boolean overhead)
This constructor will make a location at a building and room number with other fields. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object other)
Returns true if the argument is not null, is an instance of the Location class, and its building and room numbers are the same as this object's. |
java.lang.String |
getBuilding()
Returns the building number of this location. |
int |
getMaxOccupancy()
Returns the maximum occupancy of this location. |
java.lang.String |
getRoom()
Returns the room number of this location. |
java.lang.String |
getType()
|
boolean |
hasLaptopConnectivity()
This method returns whether this room has laptop connectivity. |
boolean |
hasOverhead()
This method returns whether this room has an overhead. |
boolean |
isADACompliant()
This method returns whether this room is disabled-accessible. |
boolean |
isAvailable(int dayOfWeek,
Time s,
Time e)
This method will tell whether this location is availble during the given time slot. |
boolean |
isAvailable(Week week,
Time s,
Time e)
Determines whether a location is available during the given span of time, over the given week of days. |
boolean |
isLab()
Returns whether this location is a lab room. |
boolean |
isLecture()
Returns whether this location is a lecture room. |
boolean |
isSmartRoom()
This method returns whether this is a smart room. |
boolean |
isValidLocation(Location location)
Returns whether the given location is valid. |
boolean |
isValidLocationDB()
Returns whether the currect class is a valid LocationDB. |
boolean |
providesFor(Course c)
Determines whether this location provides the required equipment for a given course, and is of a compatible type. |
void |
setBusy(int dayOfWeek,
Time s,
Time e)
This method will take in a day, start time, and end time and set that time interval as busy for this location. |
boolean |
setBusy(Time s,
Time e,
Week week)
Books this location for a given time over a given span of days (Week). |
java.lang.String |
toString()
Returns the building-dash-room string representation of this location. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static Location TBA
private java.lang.String building
private java.lang.String room
private int maxOccupancy
private java.lang.String type
private Location.ProvidedEquipment providedEquipment
private boolean adaCompliant
private WeekAvail availability
Constructor Detail |
---|
public Location(int bldg, int room)
bldg
- the building number.room
- the room number.public Location(Location l)
l
- Location to copypublic Location(java.lang.String building, java.lang.String room)
building
- room
- public Location(java.lang.String building, java.lang.String room, int maxOccupancy, java.lang.String type, boolean disabilities, boolean smartroom, boolean laptop, boolean overhead)
building
- room
- Method Detail |
---|
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- the object to compare with
public java.lang.String getBuilding()
public int getMaxOccupancy()
public java.lang.String getRoom()
public java.lang.String getType()
public boolean hasLaptopConnectivity()
public boolean hasOverhead()
public boolean isADACompliant()
public boolean isAvailable(int dayOfWeek, Time s, Time e)
dayOfWeek
- The day (0 = Sun; 6 = Sat)s
- The start timee
- The end time
public boolean isAvailable(Week week, Time s, Time e)
week
- The week of days that must be frees
- The start timee
- The end time
public void setBusy(int dayOfWeek, Time s, Time e)
dayOfWeek
- The day (0 = Sun; 6 = Sat)s
- The start timee
- The end time
Written by: Eric Liebowitzpublic boolean setBusy(Time s, Time e, Week week)
week
- The span of days to books
- The start timee
- The end time
public boolean isLab()
public boolean isLecture()
public boolean isSmartRoom()
public boolean isValidLocation(Location location)
public boolean isValidLocationDB()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean providesFor(Course c)
c
- The course to provide for
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |