View Javadoc

1   package net.obsearch.example;
2   
3   import net.obsearch.OB;
4   import net.obsearch.exception.OBException;
5   import net.obsearch.index.utils.OBFactory;
6   
7   
8   public class OBSliceFactory implements OBFactory<OBSlice> {
9   
10      public static  int maxSliceSize = 300;
11      
12      
13      
14      
15  
16      /**
17       * @return the maxSliceSize
18       */
19      public int getMaxSliceSize() {
20          return maxSliceSize;
21      }
22  
23      /**
24       * @param maxSliceSize the maxSliceSize to set
25       */
26      public void setMaxSliceSize(int maxSliceSize) {
27          this.maxSliceSize = maxSliceSize;
28      }
29  
30      @Override
31      public OBSlice create(String x) throws OBException{
32          // TODO Auto-generated method stub
33          return new OBSlice(x);
34      }
35  
36      @Override
37      public boolean shouldProcess(OBSlice obj) throws OBException{
38          return obj.size() <= maxSliceSize;
39      }
40  
41  }