this.instance.setFieldsForTypes(modelMap);
this.instance.setFieldsForTypes(modelMap);
com.setFieldsForTypes( new HashMap<String, ModelField[]>() {
@Test public void testGlobalAndFacts() { final SuggestionCompletionEngine com = new SuggestionCompletionEngine(); com.setGlobalVariables( new HashMap<String, String>() { { put( "y", "Foo" ); } } ); com.setFieldsForTypes( new HashMap<String, ModelField[]>() { { put( "Foo", new ModelField[]{ new ModelField( "a", String.class.getName(), FIELD_CLASS_TYPE.REGULAR_CLASS, "String" ) } ); } } ); assertFalse( com.isGlobalVariable( "x" ) ); assertTrue( com.isGlobalVariable( "y" ) ); }
sce.setFieldsForTypes( new HashMap<String, ModelField[]>() {
@Test public void testAdd() { final SuggestionCompletionEngine com = new SuggestionCompletionEngine(); com.setFactTypes( new String[]{"Foo"} ); com.setFieldsForTypes( new HashMap<String, ModelField[]>() { { put( "Foo", new ModelField[]{ new ModelField( "a", String.class.getName(), FIELD_CLASS_TYPE.REGULAR_CLASS, "String" ) } ); } } ); assertEquals( 1, com.getFactTypes().length ); assertEquals( "Foo", com.getFactTypes()[0] ); assertEquals( 1, com.getFieldCompletions( "Foo" ).length ); assertEquals( "a", com.getFieldCompletions( "Foo" )[0] ); }
sce.setFieldsForTypes( new HashMap<String, ModelField[]>() {
sce.setFieldsForTypes( new HashMap<String, ModelField[]>() {
SuggestionCompletionEngine sce = new SuggestionCompletionEngine(); sce.setFieldsForTypes( new HashMap<String, ModelField[]>() {
SuggestionCompletionEngine sce = new SuggestionCompletionEngine(); sce.setFieldsForTypes( new HashMap<String, ModelField[]>() {
com.setFieldsForTypes( new HashMap<String, ModelField[]>() {
sce.setFieldsForTypes( new HashMap<String, ModelField[]>() {
com.setFieldsForTypes( new HashMap<String, ModelField[]>() {