List of usage examples for org.apache.commons.lang ArrayUtils addAll
public static double[] addAll(double[] array1, double[] array2)
Adds all the elements of the given arrays into a new array.
From source file:gda.data.scan.datawriter.scannablewriter.SingleScannableWriter.java
private final String componentNameFor(final Scannable s, final int i) { return ArrayUtils.addAll((s.getInputNames() != null) ? s.getInputNames() : new String[] {}, (s.getExtraNames() != null) ? s.getExtraNames() : new String[] {})[i].toString(); }
From source file:net.michaelpigg.xbeelib.protocol.XbeeAddressTest.java
public void test16BitCombinedAddress() throws DecoderException { logger.info("test16BitCombinedAddress"); XbeeAddress address = XbeeAddress.getAddress(new byte[] { 0x0, 0x1 }); byte[] combinedAddress = address.getCombinedAddress(); final byte[] expected = ArrayUtils.addAll(XbeeAddress.BROADCAST_64_BIT, new byte[] { 0x0, 0x1 }); logger.info("actual value {}", Hex.encodeHexString(combinedAddress)); logger.info("expected value {}", Hex.encodeHexString(expected)); assertEquals(combinedAddress, expected); }
From source file:de.berlin.magun.nfcmime.core.CrcGenerator.java
/** * Creates a single byte array out of a NdefRecord[] array. * @param records/*from www . ja v a 2s . com*/ * @return byte[] */ private byte[] getByteArray(NdefRecord[] records) { byte[] overallBytes = new byte[0]; for (int i = 0; i < records.length; i++) { overallBytes = ArrayUtils.addAll(overallBytes, records[i].toByteArray()); } return overallBytes; }
From source file:com.dilipkumarg.qb.UpdateQueryBuilder.java
@Override protected SqlQuery buildInsertableQuery() { SqlQuery whereQuery = buildWhere();/*w ww .j a v a 2 s.c o m*/ String queryString = String.format(UPDATE_TEMPLATE, getTable().getTableName(), buildArgumentsQueryString(), whereQuery.getQuery()); Object[] args = ArrayUtils.addAll(getArguments().values().toArray(), whereQuery.getArgs()); return new SqlQuery(queryString, args); }
From source file:com.palantir.atlasdb.cli.runner.AbstractTestRunner.java
private String[] buildArgs() throws URISyntaxException { String filePath = getResourcePath(getKvsConfigFileName()); String cmdName = cmdClass.getAnnotation(Command.class).name(); String[] initArgs = new String[] { cmdName, "-c", filePath }; return (String[]) ArrayUtils.addAll(initArgs, args); }
From source file:net.sourceforge.jaulp.io.annotations.ImportResourcesUtils.java
/** * Gets a map with ImportResource objects and the corresponding to the found class from the * given package Name. The search is made recursive. The key from an entry of the map is the * class where the ImportResource objects found and the value is an Array of the ImportResource * objects that contains in the class.//from w w w. ja va 2 s.c om * * @param packageName * the package name * @return the import resources * @throws ClassNotFoundException * the class not found exception * @throws IOException * Signals that an I/O exception has occurred. */ public static Map<Class<?>, ImportResource[]> getImportResources(String packageName) throws ClassNotFoundException, IOException { final Map<Class<?>, ImportResource[]> resourcesMap = new LinkedHashMap<>(); final Class<ImportResources> importResourcesClass = ImportResources.class; final Class<ImportResource> importResourceClass = ImportResource.class; final Set<Class<?>> importResourcesClasses = AnnotationUtils.getAllAnnotatedClasses(packageName, importResourcesClass); final Set<Class<?>> importResourceClasses = AnnotationUtils.getAllAnnotatedClasses(packageName, importResourceClass); importResourcesClasses.addAll(importResourceClasses); for (Class<?> annotatedClass : importResourcesClasses) { final ImportResources importResources = annotatedClass.getAnnotation(ImportResources.class); ImportResource[] importResourcesArray = null; ImportResource[] importResourceArray = null; if (importResources != null) { importResourcesArray = importResources.resources(); } final ImportResource importResource = annotatedClass.getAnnotation(ImportResource.class); if (importResource != null) { importResourceArray = new ImportResource[1]; importResourceArray[0] = importResource; } ImportResource[] array = (ImportResource[]) ArrayUtils.addAll(importResourceArray, importResourcesArray); Arrays.sort(array, new ImportResourceComparator()); resourcesMap.put(annotatedClass, array); } return resourcesMap; }
From source file:com.github.ningg.flume.instrumentation.SourceCounter.java
public SourceCounter(String name, String[] attributes) { super(Type.SOURCE, name, (String[]) ArrayUtils.addAll(attributes, ATTRIBUTES)); }
From source file:com.siberhus.tdfl.transform.DefaultFieldSet.java
public DefaultFieldSet(String values[], String labels[]) { Assert.notNull(values);//from w ww . jav a 2s . c o m Assert.notNull(labels); this.values = (String[]) values.clone(); if (values.length < labels.length) { int addSize = labels.length - values.length; values = (String[]) ArrayUtils.addAll(values, new String[addSize]); } // if (values.length != labels.length) { // throw new IllegalArgumentException("Field labels must be same length as values: labels=" // + Arrays.asList(labels) + ", values=" + Arrays.asList(values)); // } this.labels = Arrays.asList(labels); }
From source file:info.magnolia.voting.voters.VoterSet.java
public void setVoters(Voter[] voters) { this.voters = (Voter[]) ArrayUtils.addAll(this.voters, voters); }
From source file:com.yahoo.egads.utilities.SpectralMethods.java
public static RealMatrix createHankelMatrix(RealMatrix data, int windowSize) { int n = data.getRowDimension(); int m = data.getColumnDimension(); int k = n - windowSize + 1; RealMatrix res = MatrixUtils.createRealMatrix(k, m * windowSize); double[] buffer = {}; for (int i = 0; i < n; ++i) { double[] row = data.getRow(i); buffer = ArrayUtils.addAll(buffer, row); if (i >= windowSize - 1) { RealMatrix mat = MatrixUtils.createRowRealMatrix(buffer); res.setRowMatrix(i - windowSize + 1, mat); buffer = ArrayUtils.subarray(buffer, m, buffer.length); }/*from w ww . ja v a 2 s. co m*/ } return res; }