Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
add javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Huang committed Jul 18, 2013
1 parent 4ff622c commit 7707c74
Showing 1 changed file with 13 additions and 1 deletion.
Expand Up @@ -24,7 +24,10 @@
import org.zanata.webtrans.shared.model.TransHistoryItem;

/**
* @author Patrick Huang <a href="mailto:pahuang@redhat.com">pahuang@redhat.com</a>
* This class holds two distinct translation history items at most. They are then used for comparison.
* The object created is immutable. See test for more detail.
*
* @author Patrick Huang <a href="mailto:pahuang@redhat.com">pahuang@redhat.com</a>
*/
class ComparingPair
{
Expand Down Expand Up @@ -52,6 +55,15 @@ TransHistoryItem two()
return two;
}

/**
* Add item to this holder.
* If item already exist in this holder, it will be removed.
* If current holder is full (already contains two items), new item won't be added in. i.e. no op.
* Otherwise it will be added to the holder.
*
* @param newItem to be added/removed item
* @return a new object of this class
*/
public ComparingPair addOrRemove(TransHistoryItem newItem)
{
if (isEmpty())
Expand Down

0 comments on commit 7707c74

Please sign in to comment.