1 10 package com.hp.hpl.jena.reasoner.rulesys; 11 12 import com.hp.hpl.jena.reasoner.rulesys.builtins.*; 13 import java.util.*; 14 15 22 public class BuiltinRegistry { 23 24 25 public static BuiltinRegistry theRegistry; 26 27 28 protected Map builtins = new HashMap(); 29 30 31 protected Map builtinsByURI = new HashMap(); 32 33 static { 35 theRegistry = new BuiltinRegistry(); 36 37 theRegistry.register(new Print()); 38 theRegistry.register(new AddOne()); 39 theRegistry.register(new LessThan()); 40 theRegistry.register(new GreaterThan()); 41 theRegistry.register(new LE()); 42 theRegistry.register(new GE()); 43 theRegistry.register(new Equal()); 44 theRegistry.register(new NotFunctor()); 45 theRegistry.register(new IsFunctor()); 46 theRegistry.register(new NotEqual()); 47 theRegistry.register(new MakeTemp()); 48 theRegistry.register(new NoValue()); 49 theRegistry.register(new Remove()); 50 theRegistry.register(new Sum()); 51 theRegistry.register(new Difference()); 52 theRegistry.register(new Product()); 53 theRegistry.register(new Bound()); 54 theRegistry.register(new Unbound()); 55 theRegistry.register(new IsLiteral()); 56 theRegistry.register(new NotLiteral()); 57 theRegistry.register(new IsBNode()); 58 theRegistry.register(new NotBNode()); 59 theRegistry.register(new IsDType()); 60 theRegistry.register(new NotDType()); 61 theRegistry.register(new CountLiteralValues()); 62 theRegistry.register(new Max()); 63 theRegistry.register(new Min()); 64 theRegistry.register(new ListLength()); 65 theRegistry.register(new ListEqual()); 66 theRegistry.register(new ListNotEqual()); 67 theRegistry.register(new ListContains()); 68 theRegistry.register(new ListNotContains()); 69 theRegistry.register(new ListMapAsSubject()); 70 theRegistry.register(new ListMapAsObject()); 71 72 theRegistry.register(new MakeInstance()); 73 theRegistry.register(new Table()); 74 theRegistry.register(new TableAll()); 75 76 theRegistry.register(new Hide()); 77 78 theRegistry.register(new AssertDisjointPairs()); 80 } 81 82 85 public BuiltinRegistry() { 86 } 87 88 93 public void register(String functor, Builtin impl) { 94 builtins.put(functor, impl); 95 builtinsByURI.put(impl.getURI(), impl); 96 } 97 98 102 public void register(Builtin impl) { 103 builtins.put(impl.getName(), impl); 104 builtinsByURI.put(impl.getURI(), impl); 105 } 106 107 112 public Builtin getImplementation(String functor) { 113 return (Builtin)builtins.get(functor); 114 } 115 116 121 public Builtin getImplementationByURI(String uri) { 122 return (Builtin)builtinsByURI.get(uri); 123 } 124 125 } 126 127 156 | Popular Tags |