@@ -95,58 +95,10 @@ public static List<MemberInstance<?>> outputs(StructInstance<?> op) {
9595 .filter (memberInstance -> memberInstance .member ().isOutput ()) //
9696 .collect (Collectors .toList ());
9797 }
98-
99- // /** Gets the namespace portion of the given op name. */
100- // public static String getNamespace(final String opName) {
101- // if (opName == null) return null;
102- // final int dot = opName.lastIndexOf(".");
103- // return dot < 0 ? null : opName.substring(0, dot);
104- // }
105- //
106- // /** Gets the simple portion (without namespace) of the given op name. */
107- // public static String stripNamespace(final String opName) {
108- // if (opName == null) return null;
109- // final int dot = opName.lastIndexOf(".");
110- // return dot < 0 ? opName : opName.substring(dot + 1);
111- // }
112- //
113- // /**
114- // * Gets a string describing the given op request.
115- // *
116- // * @param name The op's name.
117- // * @param args The op's input arguments.
118- // * @return A string describing the op request.
119- // */
120- // public static String opString(final String name, final Object... args) {
121- // final StringBuilder sb = new StringBuilder();
122- // sb.append(name + "(\n\t\t");
123- // boolean first = true;
124- // for (final Object arg : args) {
125- // if (first) first = false;
126- // else sb.append(",\n\t\t");
127- // if (arg == null) sb.append("null");
128- // else if (arg instanceof Class) {
129- // // NB: Class instance used to mark argument type.
130- // sb.append(((Class<?>) arg).getSimpleName());
131- // }
132- // else sb.append(arg.getClass().getSimpleName());
133- // }
134- // sb.append(")");
135- // return sb.toString();
136- // }
137-
138- // -- Helper methods --
139-
140- // /** Filters a list with the given predicate, concealing boilerplate crap.
141- // */
142- // private static <T> List<T> filter(final List<T> list, final Predicate<T>
143- // p) {
144- // return list.stream().filter(p).collect(Collectors.toList());
145- // }
146-
147- // // TODO: Move to Context.
148- // private static boolean isInjectable(final Class<?> type) {
149- // return Service.class.isAssignableFrom(type) || //
150- // Context.class.isAssignableFrom(type);
151- // }
98+
99+ public static double getPriority (final OpCandidate candidate ) {
100+ // TODO: Think about what to do about non @Plugin-based ops...?
101+ // What if there is no annotation? How to discern a priority?
102+ return candidate .opInfo ().getAnnotation ().priority ();
103+ }
152104}
0 commit comments