Example usage for org.apache.commons.lang ArrayUtils addAll

List of usage examples for org.apache.commons.lang ArrayUtils addAll

Introduction

In this page you can find the example usage for org.apache.commons.lang ArrayUtils addAll.

Prototype

public static double[] addAll(double[] array1, double[] array2) 

Source Link

Document

Adds all the elements of the given arrays into a new array.

Usage

From source file:marytts.tools.voiceimport.VoicePackager.java

/**
 * Get the data files for this voice (which go into <tt>MARYBASE/lib/voices</tt>) and put them in a &lt;property, File&gt; Map
 * so that they can be accessed individually by the corresponding property key, e.g. "WaveTimelineMaker.waveTimeline" &rarr;
 * File("VOICE_DIR/mary/timeline_waves.mry")
 * <p>/*  ww  w .  j  a  v a  2 s  .c  o m*/
 * TODO The way individual components provide access to their properties is a little patchy, so for now, this method is a
 * little fragile!
 * 
 * @return the file Map
 */
protected HashMap<String, File> getVoiceDataFiles() {
    HashMap<String, File> files = new HashMap<String, File>();

    if (getProp(VOICETYPE).equalsIgnoreCase("HNM")) {
        TIMELINE = HNMTIMELINE;
    } else {
        TIMELINE = WAVETIMELINE;
    }

    String[] properties = { CARTFILE, DURTREE, F0LEFTTREE, F0MIDTREE, F0RIGHTTREE, HALFPHONEFEATSAC,
            HALFPHONEFEATDEFAC, HALFPHONEUNITS, JOINCOSTFEATS, JOINCOSTFEATDEF, PHONEFEATDEF, TIMELINE,
            BASETIMELINE, EXAMPLETEXTFILE };

    // vocalization files, if available:
    if ("true".equals(getProp(VOCALIZATIONSUPPORT))) {
        String[] vocalizationProperties = { "VocalizationFeatureFileWriter.featureDefinition",
                "VocalizationTimelineMaker.waveTimeline", "VocalizationFeatureFileWriter.featureFile",
                "VocalizationUnitfileWriter.unitFile", "VocalizationIntonationWriter.intonationTimeLineFile",
                "HNMFeatureFileWriter.hnmAnalysisTimelineFile",
                "VocalizationIntonationWriter.intonationFeatureDefinition" };
        properties = (String[]) ArrayUtils.addAll(properties, vocalizationProperties);
    }

    for (String property : properties) {
        String fileName;
        try {
            fileName = db.getProperty(property);
        } catch (NullPointerException e) {
            throw e;
        }
        File file = new File(fileName);
        files.put(property, file);
    }

    return files;
}

From source file:com.fortify.processrunner.cli.CLIOptionDefinition.java

private static final String[] appendArrays(String[] array1, String[] array2) {
    return (String[]) ArrayUtils.addAll(array1, array2);
}

From source file:com.prowidesoftware.swift.model.SwiftCharsetUtils.java

/**
 * Gets SWIFT y charset; any character of the Y permitted set (EDI service specific set), upper case only.
 *//*from  ww w.j  ava  2s  . c  o  m*/
static public char[] get_y() {
    char[] result = { ' ', '.', ',', '-', '(', ')', '/', '=', '\'', '+', ':', '?', '!', '"', '%', '&', '*', ';',
            '<', '>' };
    result = ArrayUtils.addAll(result, get_a());
    result = ArrayUtils.addAll(result, get_n());
    return result;
}

From source file:eu.scidipes.toolkits.palibrary.impl.UploadRepInfoLabel.java

private void addRepInfoHelper(final RepresentationInformation newRepInfo, final CoreRIType type) {

    for (final RepresentationInformation repInfo : repInfoChildren) {

        if (type.getType().isAssignableFrom(repInfo.getClass())) {

            if (repInfo.getRepresentationInformation() == null) {

                /* Add a new 'and' container */
                final AndRepInfoGroup andGroup = ModelObjectFactory.getAndRepInfoGroup();
                repInfo.setRepresentationInformation(andGroup);
            }/*from  w  ww .  ja  v  a  2 s.  c  o  m*/

            final RepInfoGroup repInfoGroup = (RepInfoGroup) repInfo.getRepresentationInformation();

            RepresentationInformation[] newGrandChildren = null;

            if (newRepInfo instanceof RepInfoGroup) {
                newGrandChildren = ((RepInfoGroup) newRepInfo).getRepresentationInformationChildren();
            } else {
                newGrandChildren = new RepresentationInformation[] { newRepInfo };
            }

            /* Merge the two arrays and set: */
            final RepresentationInformation[] currentGrandChildren = repInfoGroup
                    .getRepresentationInformationChildren();

            final RepresentationInformation[] newGrandkids = (RepresentationInformation[]) ArrayUtils
                    .addAll(currentGrandChildren, newGrandChildren);

            repInfoGroup.setRepresentationInformationChildren(newGrandkids);

        }

    }

}

From source file:com.aliyun.odps.mapred.bridge.LotReducerUDTF.java

@Override
public void setup(ExecutionContext eCtx) {
    ctx = new ReduceContextImpl(conf);
    Column[] ks = conf.getMapOutputKeySchema();
    Column[] vs = conf.getMapOutputValueSchema();
    inputSchema = (Column[]) ArrayUtils.addAll(ks, vs);
    UDTFTaskContextImpl udtfCtx = (UDTFTaskContextImpl) ctx;
    udtfCtx.configure(eCtx);//from w ww  . ja va2  s. co m
}

From source file:com.aliyun.odps.mapred.bridge.UDTFTaskContextImpl.java

protected Column[] getIntermediateOutputSchema() {
    Column[] intermediateFields = (Column[]) ArrayUtils.addAll(getMapOutputKeySchema(),
            getMapOutputValueSchema());
    return intermediateFields;
}

From source file:com.twinsoft.convertigo.beans.core.MySimpleBeanInfo.java

private void checkAdditionalProperties() {
    if (!additionalPropertiesLoaded) {
        checkLocalProperties();/*w  w  w.j  a v a  2 s  .  c  o  m*/
        if (additionalBeanClass != null) {
            try {
                properties = (PropertyDescriptor[]) ArrayUtils.addAll(properties,
                        CachedIntrospector.getBeanInfo(additionalBeanClass).getPropertyDescriptors());
            } catch (IntrospectionException e) {
            }
        }
        additionalPropertiesLoaded = true;
    }
}

From source file:info.magnolia.templating.functions.TemplatingFunctionsTest.java

@Test
public void testChildrenFromContentMap() throws RepositoryException {
    // GIVEN//from  w  ww. j ava2  s  .  c o m
    String[] expectedNamesDepth1 = (String[]) ArrayUtils.addAll(DEPTH_2_COMPONENT_NAMES, DEPTH_2_PAGE_NAMES);

    // WHEN
    List<ContentMap> resultChildNodes = functions.children(topPageContentMap);

    // THEN
    assertContentMapListEqualStringDefinitions(expectedNamesDepth1, resultChildNodes);
}

From source file:br.gov.frameworkdemoiselle.ldap.internal.ClazzUtils.java

/**
 * Build a array of super classes fields
 * /*ww w.ja  va  2s .  c o  m*/
 * @return Array of Super Classes Fields
 */
public static Field[] getSuperClassesFields(Class<?> entryClass) {
    Field[] fieldArray = entryClass.getDeclaredFields();
    Class<?> superClazz = entryClass.getSuperclass();
    while (superClazz != null && !"java.lang.Object".equals(superClazz.getName())) {
        fieldArray = (Field[]) ArrayUtils.addAll(fieldArray, superClazz.getDeclaredFields());
        superClazz = superClazz.getSuperclass();
    }
    return fieldArray;
}

From source file:de.ingrid.admin.controller.GeneralController.java

private void addIncludedDataTypes(final IDataType... types) {
    Config config = JettyStarter.getInstance().config;
    // for all indices
    // check if index has the parent field and add then the included ones
    for (IDocumentProducer producer : docProducer) {
        IndexInfo indexInfo = Utils.getIndexInfo(producer, config);
        List<String> included = new ArrayList<String>();
        String[] datatypesOfIndex = config.datatypesOfIndex.get(indexInfo.getIdentifier());

        // check all data types
        for (final String dataType : datatypesOfIndex) {
            // find correct idatatype
            for (final IDataType type : types) {
                if (type.getName().equals(dataType)) {
                    // if found add all included data types
                    if (type.getIncludedDataTypes() != null) {
                        for (final IDataType include : type.getIncludedDataTypes()) {
                            // add to all datatypes field
                            if (!config.datatypes.contains(include.getName())) {
                                config.datatypes.add(include.getName());
                            }/*  w w w.  jav  a2s . com*/
                            if (ArrayUtils.contains(datatypesOfIndex, dataType)) {
                                included.add(include.getName());
                            }
                        }
                    }
                }
            }
        }
        config.datatypesOfIndex.put(indexInfo.getIdentifier(),
                (String[]) ArrayUtils.addAll(datatypesOfIndex, included.toArray()));
    }
}