List of usage examples for org.bouncycastle.util Strings split
public static String[] split(String input, char delimiter)
From source file:com.maddyhome.idea.vim.ex.handler.CommandCommandHandler.java
License:Open Source License
public boolean execute(@NotNull Editor editor, @NotNull final DataContext context, @NotNull ExCommand cmd) throws ExException { final String actionName = cmd.getArgument().trim(); final String cmdToExecute = cmd.getArgument().trim(); List<String> strings = Lists.newArrayList(Strings.split(cmdToExecute, ' ')); String excmd = strings.get(0); strings.remove(0);//from www . ja v a2 s.co m String args = Joiner.on(' ').join(strings); final Application application = ApplicationManager.getApplication(); if (application.isUnitTestMode()) { //executeAction(action, context, actionName); } else { UiHelper.runAfterGotFocus(new Runnable() { @Override public void run() { //executeAction(action, context, actionName); CommandParser.getInstance().addHandler(createCommandWrapper(excmd, args)); } }); } return true; }
From source file:net.sportics.dni.rt.client.microedition.ui.FontManager.java
License:Open Source License
void initCharData() { for (final Enumeration e = this.lookup.elements(); e.hasMoreElements();) { final KeyWidthHeight keyWidthHeight = (KeyWidthHeight) e.nextElement(); final String path = BASE_PATH + keyWidthHeight.key + "/char.data"; final InputStream in = FontManager.class.getResourceAsStream(path); // LOG.debug("InputStream for path " + path + ": " + in); final Properties props = new Properties(); try {/*from www. j a v a2s. c o m*/ try { props.load(in); final Hashtable innerMap = new Hashtable(); for (final Enumeration inner = props.keys(); inner.hasMoreElements();) { final String innerKey = (String) inner.nextElement(); final String value = props.getProperty(innerKey); final String[] widthHeight = Strings.split(value, ','); final int width = Integer.parseInt(widthHeight[0]); final int height = Integer.parseInt(widthHeight[1]); final WidthHeight wh = new WidthHeight(width, height); final int innerKeyAsInt = Integer.parseInt(innerKey); final Integer innerKeyAsInteger = new Integer(innerKeyAsInt); innerMap.put(innerKeyAsInteger, wh); LOG.config("Init char metric for font \"" + keyWidthHeight.key + "\" and char '" + ((char) Integer.parseInt(innerKey)) + "': " + wh); } this.charData.put(keyWidthHeight.key, innerMap); } finally { in.close(); } } catch (final NumberFormatException ex) { LOG.warn("Unable to transform character into int: " + ex.getMessage()); } catch (final Exception ex) { LOG.warn("Exception occured: " + ex.getMessage() + " - " + ex.getClass()); } } }
From source file:net.sportics.dni.rt.client.microedition.ui.FontManager.java
License:Open Source License
void initLookup() { final String fontDataPath = BASE_PATH + "font.data"; final InputStream in = FontManager.class.getResourceAsStream(fontDataPath); // LOG.debug("InputStream for path " + fontDataPath + ": " + in); final Properties props = new Properties(); try {//from w w w .j av a 2 s . c om try { props.load(in); for (final Enumeration e = props.keys(); e.hasMoreElements();) { final String key = (String) e.nextElement(); final String value = props.getProperty(key); final String[] widthHeight = Strings.split(value, ','); final int width = Integer.parseInt(widthHeight[0]); final int height = Integer.parseInt(widthHeight[1]); final Integer inKey = new Integer(Integer.parseInt(key)); final KeyWidthHeight wh = new KeyWidthHeight(inKey, width, height); lookup.addElement(wh); LOG.config("Init font metric for: " + wh); } } finally { in.close(); } } catch (final NumberFormatException ex) { LOG.warn("Unable to transform character into int: " + ex.getMessage()); } catch (final Exception ex) { LOG.warn("Exception occured: " + ex.getMessage() + " - " + ex.getClass()); } }
From source file:org.apache.drill.exec.record.RecordBatchSizer.java
License:Apache License
private ColumnSize getComplexColumn(String path) { String[] segments = Strings.split(path, '.'); Map<String, ColumnSize> map = columnSizes; return getComplexColumnImpl(segments, 0, map); }