Javadoc updates.

This commit is contained in:
asofold 2012-12-14 10:44:10 +01:00
parent c433bfe215
commit a05d3e06c8

View File

@ -116,7 +116,7 @@ public class ActionFrequency {
/** /**
* Get score of first end buckets, with factor. * Get score of first end buckets, with factor.
* @param end Number of buckets including start. This is not included. * @param end Number of buckets including start. The end is not included.
* @param factor * @param factor
* @return * @return
*/ */
@ -125,7 +125,7 @@ public class ActionFrequency {
} }
/** /**
* Get score from startBucket on, with factor. * Get score from start on, with factor.
* @param start This is included. * @param start This is included.
* @param factor * @param factor
* @return * @return
@ -135,7 +135,7 @@ public class ActionFrequency {
} }
/** /**
* Get score from startBucket on, until before maxBucket, with factor. * Get score from start on, until before end, with factor.
* @param start This is included. * @param start This is included.
* @param end This is not included. * @param end This is not included.
* @param factor * @param factor
@ -151,10 +151,19 @@ public class ActionFrequency {
return score; return score;
} }
/**
* Set the value for a buckt.
* @param n
* @param value
*/
public final void setBucket(final int n, final float value){ public final void setBucket(final int n, final float value){
buckets[n] = value; buckets[n] = value;
} }
/**
* Set the reference time.
* @param time
*/
public final void setTime(final long time){ public final void setTime(final long time){
this.time = time; this.time = time;
} }
@ -183,6 +192,10 @@ public class ActionFrequency {
return durBucket; return durBucket;
} }
/**
* Serialize to a String line.
* @return
*/
public final String toLine(){ public final String toLine(){
final StringBuilder buffer = new StringBuilder(50); final StringBuilder buffer = new StringBuilder(50);
buffer.append(buckets.length + ","+durBucket+","+time); buffer.append(buckets.length + ","+durBucket+","+time);
@ -192,6 +205,11 @@ public class ActionFrequency {
return buffer.toString(); return buffer.toString();
} }
/**
* Deserialize from a string.
* @param line
* @return
*/
public static ActionFrequency fromLine(final String line){ public static ActionFrequency fromLine(final String line){
String[] split = line.split(","); String[] split = line.split(",");
if (split.length < 3) throw new RuntimeException("Bad argument length."); // TODO if (split.length < 3) throw new RuntimeException("Bad argument length."); // TODO