com.google.code.facebookapi
Class Pair<N,V>

java.lang.Object
  extended by com.google.code.facebookapi.Pair<N,V>
Type Parameters:
N - first element in the pair.
V - second element in the pair.
All Implemented Interfaces:
IPair<N,V>, java.io.Serializable
Direct Known Subclasses:
FeedFacebookPhoto, FeedImage, FeedUserPhoto

public class Pair<N,V>
extends java.lang.Object
implements IPair<N,V>, java.io.Serializable

Simple data structure for grouping two values together. Required by some API calls.

See Also:
Serialized Form

Field Summary
 N first
          The first element in the pair.
 V second
          The second element in the pair.
 
Constructor Summary
Pair(N name, V value)
          Constructor.
 
Method Summary
 N getFirst()
           
 V getSecond()
           
 void setFirst(N first)
          Set the first element in the pair
 void setSecond(V second)
          Set the second element in the pair
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

first

public N first
The first element in the pair.


second

public V second
The second element in the pair.

Constructor Detail

Pair

public Pair(N name,
            V value)
Constructor.

Parameters:
name - the first value in the pair.
value - the second value in the pair.
Method Detail

setFirst

public void setFirst(N first)
Set the first element in the pair

Specified by:
setFirst in interface IPair<N,V>
Parameters:
first - the object to set

getFirst

public N getFirst()
Specified by:
getFirst in interface IPair<N,V>
Returns:
the first object in the pair

setSecond

public void setSecond(V second)
Set the second element in the pair

Specified by:
setSecond in interface IPair<N,V>
Parameters:
second - the object to set

getSecond

public V getSecond()
Specified by:
getSecond in interface IPair<N,V>
Returns:
the second object in the pair


Copyright © 2010. All Rights Reserved.