com.mcdermottroe.exemplar.output
Class LanguageAPIPair

java.lang.Object
  extended by com.mcdermottroe.exemplar.output.LanguageAPIPair
All Implemented Interfaces:
Copyable<LanguageAPIPair>, Comparable<LanguageAPIPair>

public class LanguageAPIPair
extends Object
implements Comparable<LanguageAPIPair>, Copyable<LanguageAPIPair>

A class representing a language-API pair.

Since:
0.1

Field Summary
private  String api
          The API.
private  String language
          The language.
 
Constructor Summary
LanguageAPIPair(String theLanguage, String theApi)
          Basic constructor to set the members.
 
Method Summary
 int compareTo(LanguageAPIPair other)
          Implement Comparable so that LanguageAPIPair objects can be contained in a sorted Collection.
 boolean equals(Object o)
          See Object.equals(Object).
 String getAPI()
          Accessor for the api member.
 LanguageAPIPair getCopy()
          Creates a deep copy of the current object and returns it.
 String getLanguage()
          Accessor for the language member.
 int hashCode()
          See Object.hashCode().
 String toString()
          See Object.toString().
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

language

private final String language
The language. May not be null.


api

private final String api
The API. May be null.

Constructor Detail

LanguageAPIPair

public LanguageAPIPair(String theLanguage,
                       String theApi)
Basic constructor to set the members.

Parameters:
theLanguage - The value for the language member.
theApi - The value for the api member.
Method Detail

getLanguage

public String getLanguage()
Accessor for the language member.

Returns:
The language member. Guaranteed not to be null.

getAPI

public String getAPI()
Accessor for the api member.

Returns:
The api member. May be null.

equals

public boolean equals(Object o)
See Object.equals(Object).

Overrides:
equals in class Object
Parameters:
o - The object to compare against.
Returns:
True if this is equal to o.

hashCode

public int hashCode()
See Object.hashCode().

Overrides:
hashCode in class Object
Returns:
A hash code.

toString

public String toString()
See Object.toString().

Overrides:
toString in class Object
Returns:
A descriptive String.

compareTo

public int compareTo(LanguageAPIPair other)
Implement Comparable so that LanguageAPIPair objects can be contained in a sorted Collection.

Specified by:
compareTo in interface Comparable<LanguageAPIPair>
Parameters:
other - The object to compare this one to.
Returns:
-1, 0 or 1 if this object is less-than, equal to, or greater than o, respectively.

getCopy

public LanguageAPIPair getCopy()
Creates a deep copy of the current object and returns it.

Specified by:
getCopy in interface Copyable<LanguageAPIPair>
Returns:
A deep copy of the current object.