public static boolean[] toBooleanArray( ceylon.language.Iterable<? extends ceylon.language.Boolean, ? extends java.lang.Object> sequence, boolean... initialElements) { if (sequence instanceof ceylon.language.List) return toBooleanArray( (ceylon.language.List<? extends ceylon.language.Boolean>) sequence, initialElements); List<ceylon.language.Boolean> list = collectIterable(sequence); boolean[] ret = new boolean[list.size() + initialElements.length]; int i = 0; for (; i < initialElements.length; i++) { ret[i] = initialElements[i]; } for (ceylon.language.Boolean e : list) { ret[i++] = e.booleanValue(); } return ret; }
private void store() { IProject project = getSelectedProject(); if (CeylonNature.isEnabled(project)) { String systemRepo = getCeylonSystemRepo(project); new CeylonNature( systemRepo, explodeModules, backendJava, backendJs, astAwareIncrementalBuids, verbose) .addToProject(project); CeylonProjectConfig<IProject> config = ceylonModel().getProject(project).getConfiguration(); if (offlineOption != null) { config.setProjectOffline(ceylon.language.Boolean.instance(offlineOption)); } config.save(); } }
private Element unsafeItem(int index) { if (array instanceof char[]) { return (Element) Character.instance(((char[]) array)[index]); } else if (array instanceof byte[]) { return (Element) Integer.instance(((byte[]) array)[index]); } else if (array instanceof short[]) { return (Element) Integer.instance(((short[]) array)[index]); } else if (array instanceof int[]) { return (Element) Integer.instance(((int[]) array)[index]); } else if (array instanceof long[]) { return (Element) Integer.instance(((long[]) array)[index]); } else if (array instanceof float[]) { return (Element) Float.instance(((float[]) array)[index]); } else if (array instanceof double[]) { return (Element) Float.instance(((float[]) array)[index]); } else if (array instanceof boolean[]) { return (Element) Boolean.instance(((boolean[]) array)[index]); } else if (array instanceof java.lang.String[]) { return (Element) String.instance(((java.lang.String[]) array)[index]); } else { return ((Element[]) array)[index]; } }