@Override @SuppressWarnings("unchecked") public List<TreeNode> children() { C.List<TreeNode> list = (C.List) C.list(staticChildren.values()); return list.append(dynamicChilds); }
@Override public List<TreeNode> children() { List<TreeNode> filteredChildren = new ArrayList<>(); C.List<TreeNode> pathToKid = path.append(theNode); for (TreeNode kid : theNode.children()) { if (hasAppliedChild(pathToKid, kid)) { filteredChildren.add(new FilteredTreeNode(pathToKid, kid, filter)); } } return filteredChildren; }
@Override @SuppressWarnings("unchecked") public List<TreeNode> children() { C.List<TreeNode> list = (C.List) C.list(staticChildren.values()); return list.append(dynamicChilds); }
public static <T> List<T> newList(T t1, T t2) { return new DelegatingList<T>(10).append(t1).append(t2); }
private boolean hasAppliedChild(C.List<TreeNode> path, TreeNode theNode) { if (applied(path, theNode)) { return true; } List<TreeNode> children = theNode.children(); C.List<TreeNode> pathToKid = path.append(theNode); for (TreeNode kid : children) { if (hasAppliedChild(pathToKid, kid)) { return true; } } return false; } }
private boolean hasAppliedChild(C.List<TreeNode> path, TreeNode theNode) { if (applied(path, theNode)) { return true; } List<TreeNode> children = theNode.children(); C.List<TreeNode> pathToKid = path.append(theNode); for (TreeNode kid : children) { if (hasAppliedChild(pathToKid, kid)) { return true; } } return false; } }
public List<FieldOptionAnnoInfo> fieldOptionAnnoInfoList(AppClassLoader appClassLoader) { C.List<FieldOptionAnnoInfo> list = C.list(fieldOptionAnnoInfoMap.values()); CommanderClassMetaInfo p = parent(appClassLoader); if (null != p && NULL != p) { list = list.append(p.fieldOptionAnnoInfoList(appClassLoader)); } return list; }
@Override public List<TreeNode> children() { List<TreeNode> filteredChildren = new ArrayList<>(); C.List<TreeNode> pathToKid = path.append(theNode); for (TreeNode kid : theNode.children()) { if (hasAppliedChild(pathToKid, kid)) { filteredChildren.add(new FilteredTreeNode(pathToKid, kid, filter)); } } return filteredChildren; }
@Override public C.List<T> insert(int index, List<T> subList) throws IndexOutOfBoundsException { if (index == 0) { return C.list(subList).prepend(v); } else if (index == 1) { return C.list(subList).append(v); } throw new IndexOutOfBoundsException(); }
@Override public C.List<T> insert(int index, List<T> subList) throws IndexOutOfBoundsException { if (index == 0) { return C.list(subList).prepend(v); } else if (index == 1) { return C.list(subList).append(v); } throw new IndexOutOfBoundsException(); }
@Override public C.List<T> insert(int index, T... ta) throws IndexOutOfBoundsException { if (index == 0) { return C.listOf(ta).prepend(v); } else if (index == 1) { return C.listOf(ta).append(v); } throw new IndexOutOfBoundsException(); }
private ElementLoaderProvider(BeanSpec spec, Provider<T> provider, Genie genie) { this.realProvider = provider; C.List<LoaderInfo> loaders = loaders(genie, spec).sorted(); this.loader = loaders.first(); List<? extends FilterInfo> tail = loaders.head(-1); this.filters = C.Set(filters(genie, spec).append(tail)); this.genie = genie; }
@Override public C.List<T> insert(int index, T... ta) throws IndexOutOfBoundsException { if (index == 0) { return C.listOf(ta).prepend(v); } else if (index == 1) { return C.listOf(ta).append(v); } throw new IndexOutOfBoundsException(); }
private static List<String> tokenOf(Class<?> entryClass) { C.List<String> tokens = C.newList(); tokens.addAll(classNameTokensReversed(entryClass)); Class<?> enclosingClass = entryClass.getEnclosingClass(); while (null != enclosingClass) { tokens.addAll(classNameTokensReversed(enclosingClass)); enclosingClass = entryClass.getEnclosingClass(); } String pkgName = JavaNames.packageNameOf(entryClass); tokens.append(S.fastSplit(pkgName, ".").reverse()); return tokens.reverse(); }
private ElementLoaderProvider(BeanSpec spec, Provider<T> provider, Genie genie) { this.realProvider = provider; C.List<LoaderInfo> loaders = loaders(genie, spec).sorted(); this.loader = loaders.first(); List<? extends FilterInfo> tail = loaders.head(-1); this.filters = C.Set(filters(genie, spec).append(tail)); this.genie = genie; }
private static List<String> tokenOf(Class<?> entryClass) { C.List<String> tokens = C.newList(); tokens.addAll(classNameTokensReversed(entryClass)); Class<?> enclosingClass = entryClass.getEnclosingClass(); while (null != enclosingClass) { tokens.addAll(classNameTokensReversed(enclosingClass)); enclosingClass = entryClass.getEnclosingClass(); } String pkgName = JavaNames.packageNameOf(entryClass); tokens.append(S.fastSplit(pkgName, ".").reverse()); return tokens.reverse(); }
public List<FieldOptionAnnoInfo> fieldOptionAnnoInfoList(AppClassLoader appClassLoader) { C.List<FieldOptionAnnoInfo> list = C.list(fieldOptionAnnoInfoMap.values()); CommanderClassMetaInfo p = parent(appClassLoader); if (null != p && NULL != p) { list = list.append(p.fieldOptionAnnoInfoList(appClassLoader)); } return list; }