Add a method to Pair that implements the following description.
```
/**
* Determine if either element of this Pair is equal
* to the argument.
* @param e the object to compare to the elements of this Pair
* @return the first element of this Pair found equal
* to e, null if neither element is equal to
* e.
*/
T elementEqualTo( T e )
```
```
/**
* Determine if either element of this Pair is equal
* to the argument.
* @param e the object to compare to the elements of this Pair
* @return the first element of this Pair found equal
* to e, null if neither element is equal to
* e.
*/
public T elementEqualTo (T e)
{
if ( e == null)
throw new NullPointerException();
if ( this.firstElement.equals( e ) || this.secondElement.equals( e ) )
return e;
else
return null;
}
```
You might also like to view...
Write a short program that shows how to defeat the slicing problem.
What will be an ideal response?
What port does the Simple Mail Transfer Protocol, or SMTP service use?
A. 25 B. 53 C. 69 D. 80
??Most Code Division Multiple Access (CDMA) networks conform to ____________ , created by the Telecommunications Industry Association (TIA).
A. ?TS-95 B. ?802.11 C. ?IS-95 D. ?IS-136
If you don't create a selection on a layer, then the filter will be applied to the entire layer.?
Answer the following statement true (T) or false (F)