|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttp.RID
public class RID
The class represents a resource identifier. There are three types of resource.
toString()) of this identifier is following.
prefix ':' identifier
Valid prefix is 'F', 'R', 'C', which correspond to Flight, Room, and Car.getName() returns the identifier part.
| Nested Class Summary | |
|---|---|
static class |
RID.Type
resource type |
| Field Summary | |
|---|---|
static int |
MAX_NAME_LENGTH
|
protected String |
name
|
protected RID.Type |
type
|
| Constructor Summary | |
|---|---|
RID()
|
|
RID(int flight)
create identifier with flight number |
|
RID(RID.Type type,
String name)
|
|
| Method Summary | |
|---|---|
int |
compareTo(RID o)
|
boolean |
equals(Object o)
|
static RID |
forCar(String loc)
convenient method to create car resource identifier |
static RID |
forFlight(int flight)
convenient method to create flight resource identifier |
static RID |
forFlight(String flight)
convenient method to create flight resource identifier |
static RID |
forRoom(String loc)
convenient method to create room resource identifier |
String |
getName()
|
RID.Type |
getType()
get type of resource id |
int |
hashCode()
|
static RID |
parse(String s)
parse external string representation |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_NAME_LENGTH
protected RID.Type type
protected String name
| Constructor Detail |
|---|
public RID()
public RID(RID.Type type,
String name)
public RID(int flight)
flight - the flight number| Method Detail |
|---|
public RID.Type getType()
public String getName()
public int hashCode()
hashCode in class Objectpublic boolean equals(Object o)
equals in class Objectpublic int compareTo(RID o)
compareTo in interface Comparable<RID>public String toString()
toString in class Objectpublic static RID forFlight(int flight)
flight - flight number
public static RID forFlight(String flight)
flight - flight number in string
public static RID forCar(String loc)
loc - location
public static RID forRoom(String loc)
loc - location
public static RID parse(String s)
s - result of toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||