/* (non-Javadoc)
* @see net.sf.logsaw.core.query.IRestrictionVisitor#visit(net.sf.logsaw.core.query.DateRestriction)
*/
@Override
public void visit(final DateRestriction restriction) {
ILogEntryFieldVisitor visitor = new LogEntryFieldVisitorAdapter() {
/* (non-Javadoc)
* @see net.sf.logsaw.core.model.LogEntryFieldVisitorAdapter#visit(net.sf.logsaw.core.model.DateLogEntryField)
*/
@Override
public void visit(DateLogEntryField fld) {
if (restriction.getOperator().equals(Operators.OPERATOR_BEFORE)) {
query.add(NumericRangeQuery.newLongRange(
fld.getKey(), null,
fld.toIndexedValue(restriction.getValue()),
false, false), Occur.MUST);
} else if (restriction.getOperator().equals(Operators.OPERATOR_AFTER)) {
query.add(NumericRangeQuery.newLongRange(
fld.getKey(),
fld.toIndexedValue(restriction.getValue()), null,
false, false), Occur.MUST);
}
}
};
restriction.getField().visit(visitor);
}
/* (non-Javadoc)
* @see net.sf.logsaw.core.query.IRestrictionVisitor#visit(net.sf.logsaw.core.query.LevelRestriction)
*/
@Override
public void visit(final LevelRestriction restriction) {
ILogEntryFieldVisitor visitor = new LogEntryFieldVisitorAdapter() {
/* (non-Javadoc)
* @see net.sf.logsaw.core.model.LogEntryFieldVisitorAdapter#visit(net.sf.logsaw.core.model.LevelLogEntryField)
*/
@Override
public void visit(LevelLogEntryField fld) {