List of usage examples for java.util Deque toArray
<T> T[] toArray(T[] a);
From source file:automenta.climatenet.ImportKML.java
public String[] getPath(Deque<String> p) { return p.toArray(new String[p.size()]); }
From source file:org.nuxeo.ecm.core.storage.ExpressionEvaluator.java
/** * Adds to the set all the sub-phrases from the start of the phraseWords. *//* w w w . ja v a 2 s. c o m*/ private static void addPhraseWords(Set<String> set, Deque<String> phraseWords) { String[] array = phraseWords.toArray(new String[0]); for (int len = 2; len <= array.length; len++) { String phrase = StringUtils.join(array, ' ', 0, len); set.add(phrase); } }
From source file:org.xframium.page.data.provider.AbstractPageDataProvider.java
public PageData[] getRecords(String recordType) { if (recordType.contains(".")) { String[] fieldArray = recordType.split("\\."); Deque<PageData> dataList = recordMap.get(fieldArray[0]).getRecordList(); String useType = getRecordType(fieldArray[0]); for (PageData p : dataList) { if (p.getName().equals(useType)) { String newName = recordType.substring(recordType.indexOf(".") + 1); if (newName.trim().isEmpty()) return new PageData[] { p }; else return (PageData[]) p.get(newName); }//from w w w . j a v a2 s . c om } return dataList.toArray(new PageData[0]); } else { if (recordMap.get(recordType) == null) return null; Deque<PageData> dataList = recordMap.get(recordType).getRecordList(); if (dataList != null) return dataList.toArray(new PageData[0]); else return null; } }