Add javadoc

Added javadoc to both of the methods

Signed-off-by: Tianyu Ge <tianyu@vt.edu>