Show CalendarFinder.java syntax highlighted
/*
* This file is distributed under the GPL v2 as part of teastats site statistics package
* http://teastats.sourceforge.net
*/
package net.time4tea.webstats.analyser.extractor;
import net.time4tea.webstats.analyser.extractor.key.KeyFinder;
import net.time4tea.webstats.analyser.extractor.value.ValueFinder;
import net.time4tea.webstats.record.Record;
import org.joda.time.DateTimeFieldType;
/**
* Originally richja Apr 2, 2006
*/
public class CalendarFinder<T extends Record> implements KeyFinder<T>, ValueFinder {
private DateTimeFieldType field;
public CalendarFinder(DateTimeFieldType field) {
this.field = field;
}
public String getKey(Record record) {
return Long.toString(record.getDate().get(field));
}
public Number getValue(Record record) {
return record.getDate().get(field);
}
}
See more files for this project here