org.deltava.beans.schedule
Class Airline

java.lang.Object
  extended by org.deltava.beans.schedule.Airline
All Implemented Interfaces:
Serializable, Comparable<Airline>, ComboAlias, Cacheable

public class Airline
extends Object
implements Serializable, ComboAlias, Comparable<Airline>, Cacheable

A class for storing Airline information.

Since:
1.0
Version:
2.1
Author:
Luke
See Also:
Serialized Form

Constructor Summary
Airline(String code)
          Create a new Airline using a code.
Airline(String code, String name)
          Create a new Airline using a code and a name.
 
Method Summary
 void addApp(String app)
          Adds a web application to this Airline.
 void addCode(String code)
          Adds an alternate airline code to this Airline.
 Object cacheKey()
          Cache key.
 int compareTo(Airline a2)
          Airline object comparator - compare the codes.
 boolean equals(Object o2)
           
 boolean getActive()
          Returns if the airline is active.
 Collection<String> getApplications()
          Returns the web applications this airline is enabled for.
 String getCode()
          Returns the airline code.
 Collection<String> getCodes()
          Returns all valid airline codes for this Airline.
 String getColor()
          The color to use then displaying this Airline's destinations or routes in a Google Map.
 String getComboAlias()
          Returns the alias to use in the HTML <OPTION> element.
 String getComboName()
          Returns the visible name to use in the HTML <OPTION> element.
 String getName()
          Returns the airline name.
 int hashCode()
           
 void setActive(boolean active)
          Updates the airline's activity flag.
 void setApps(Collection<String> apps)
          Updates the web applications this Airline is enabled for.
 void setCode(String code)
          Updates the Airline's primary code.
 void setCodes(Collection<String> codes)
          Clears and updates the list of alternate airline codes.
 void setColor(String color)
          Updates the color used when displaying this Airline's routes and destinations in a Google Map.
 void setName(String name)
          Updates the airline name.
 String toString()
          Returns the airline code.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Airline

public Airline(String code)
Create a new Airline using a code.

Parameters:
code - the Airline code
Throws:
NullPointerException - if the name is null
See Also:
getCode()

Airline

public Airline(String code,
               String name)
Create a new Airline using a code and a name.

Parameters:
code - the Airline code
name - the Airline name
Throws:
NullPointerException - If either the name or the code are null
See Also:
getCode(), getName()
Method Detail

getCode

public String getCode()
Returns the airline code.

Returns:
the airline code

getApplications

public Collection<String> getApplications()
Returns the web applications this airline is enabled for.

Returns:
a Collection of application codes
See Also:
setApps(Collection), addApp(String), AirlineInformation.getCode()

getCodes

public Collection<String> getCodes()
Returns all valid airline codes for this Airline.

Returns:
a Collection of Airline codes
See Also:
addCode(String)

getName

public String getName()
Returns the airline name.

Returns:
the airline name
See Also:
getName()

getActive

public boolean getActive()
Returns if the airline is active.

Returns:
TRUE if the airline is enabled, otherwise FALSE
See Also:
setActive(boolean)

getColor

public String getColor()
The color to use then displaying this Airline's destinations or routes in a Google Map.

Returns:
the color name
See Also:
setColor(String), MapEntry.COLORS

setActive

public void setActive(boolean active)
Updates the airline's activity flag.

Parameters:
active - TRUE if the airline is enabled, otherwise FALSE
See Also:
getActive()

addApp

public void addApp(String app)
Adds a web application to this Airline.

Parameters:
app - the application code
See Also:
setApps(Collection), getApplications(), AirlineInformation.getCode()

setApps

public void setApps(Collection<String> apps)
Updates the web applications this Airline is enabled for.

Parameters:
apps - a Collection of application codes
See Also:
getApplications(), addApp(String), AirlineInformation.getCode()

addCode

public void addCode(String code)
Adds an alternate airline code to this Airline.

Parameters:
code - the airline code
Throws:
NullPointerException - if code is null
See Also:
getCodes()

setCode

public void setCode(String code)
Updates the Airline's primary code.

Parameters:
code - the airline code
Throws:
NullPointerException - if code is null
See Also:
getCode()

setColor

public void setColor(String color)
Updates the color used when displaying this Airline's routes and destinations in a Google Map.

Parameters:
color - the color code
Throws:
IllegalArgumentException - if not a valid Google Map color
See Also:
getColor(), MapEntry.COLORS

setCodes

public void setCodes(Collection<String> codes)
Clears and updates the list of alternate airline codes.

Parameters:
codes - a Collection of airline codes
Throws:
NullPointerException - if codes is null
See Also:
addCode(String), getCodes()

getComboAlias

public String getComboAlias()
Description copied from interface: ComboAlias
Returns the alias to use in the HTML <OPTION> element.

Specified by:
getComboAlias in interface ComboAlias
Returns:
The alias for this entry

getComboName

public String getComboName()
Description copied from interface: ComboAlias
Returns the visible name to use in the HTML <OPTION> element.

Specified by:
getComboName in interface ComboAlias
Returns:
The visible name for this entry

setName

public void setName(String name)
Updates the airline name.

Parameters:
name - the Airline Name
Throws:
NullPointerException - if name is null
See Also:
getName()

compareTo

public int compareTo(Airline a2)
Airline object comparator - compare the codes.

Specified by:
compareTo in interface Comparable<Airline>

equals

public final boolean equals(Object o2)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Returns the airline code.

Overrides:
toString in class Object

cacheKey

public Object cacheKey()
Cache key.

Specified by:
cacheKey in interface Cacheable
Returns:
the Airline code


Copyright © 2004-2009 Global Virtual Airlines Group. All Rights Reserved.