View Javadoc

1   package org.tartarus.snowball;
2   
3   import java.lang.reflect.Method;
4   
5   public class Among {
6       public Among (String s, int substring_i, int result,
7   		  String methodname, SnowballProgram methodobject) {
8           this.s_size = s.length();
9           this.s = s.toCharArray();
10          this.substring_i = substring_i;
11  	this.result = result;
12  	this.methodobject = methodobject;
13  	if (methodname.length() == 0) {
14  	    this.method = null;
15  	} else {
16  	    try {
17  		this.method = methodobject.getClass().
18  		getDeclaredMethod(methodname, new Class[0]);
19  	    } catch (NoSuchMethodException e) {
20  		throw new RuntimeException(e);
21  	    }
22  	}
23      }
24  
25      public final int s_size; /* search string */
26      public final char[] s; /* search string */
27      public final int substring_i; /* index to longest matching substring */
28      public final int result; /* result of the lookup */
29      public final Method method; /* method to use if substring matches */
30      public final SnowballProgram methodobject; /* object to invoke method on */
31  };