Example usage for java.util ArrayList toString

List of usage examples for java.util ArrayList toString

Introduction

In this page you can find the example usage for java.util ArrayList toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:Main.java

public static void main(String[] args) {
    ArrayList list = new ArrayList();
    list.add(50);//from w ww  .  java2s  .  com

    System.out.println(list.toString());
}

From source file:org.commoncrawl.mapred.pipelineV3.domainmeta.blogs.feedurlid.FeedUrlIdStep.java

public static void main(String[] args) {
    ArrayList<URLCandidate> candidates = new ArrayList<URLCandidate>();
    candidates.add(new URLCandidate(new GoogleURL("http://2010.goldenplains.com.au/info/feed/")));
    candidates.add(//  w  w  w. j  av a  2  s .c  o m
            new URLCandidate(new GoogleURL("http://2010.goldenplains.com.au/supernatural-amphitheatre/feed/")));
    candidates.add(new URLCandidate(new GoogleURL("http://2010.goldenplains.com.au/tickets-pre-ballot/feed/")));

    collapseCandidates(candidates, 2);

    System.out.println(candidates.toString());

    MinMaxPriorityQueue<URLCandidate> deque2 = MinMaxPriorityQueue.create();
    deque2.add(new URLCandidate(new GoogleURL("http://2010.goldenplains.com.au/blog/feed/")));
    deque2.add(new URLCandidate(
            new GoogleURL("http://2010.goldenplains.com.au/blog/supernatural-amphitheatre/feed/")));
    deque2.add(
            new URLCandidate(new GoogleURL("http://2010.goldenplains.com.au/vlog/tickets-pre-ballot/feed/")));
    deque2.add(
            new URLCandidate(new GoogleURL("http://2010.goldenplains.com.au/blog/tickets-pre-ballot/feed/")));
    deque2.add(
            new URLCandidate(new GoogleURL("http://2010.goldenplains.com.au/vlog/tickets-pre-ballot-2/feed/")));
    deque2.add(
            new URLCandidate(new GoogleURL("http://2010.goldenplains.com.au/vlog/tickets-pre-ballot-3/feed/")));
    ArrayList<URLCandidate> test = drainToArrayList(deque2);
    System.out.println(test);

    collapseCandidates(test, 2);

    System.out.println(test.toString());
}

From source file:ypcnv.converter.main.Main.java

public static void main(String[] args)
        throws FileViewException, IOException, IllegalArgumentException, IllegalAccessException {

    LOG.debug("========> Application launch. <========");
    LOG.debug("In case of failures also examine stderr, exceptions output is there.");

    /*/*from ww  w  .j  a v  a  2s . c om*/
     * if(args.length < 1) { throw new
     * IllegalArgumentException("Command line argument can not" +
     * " be void, must be a file name."); }
     */

    // Get data from CLI arguments.
    ArrayList<DataSourceConf> confsList = (ArrayList<DataSourceConf>) ConfsFactory.build(args);

    Boolean isConfComplete = false;
    Boolean haveSource = false;
    Boolean haveDestination = false;

    Iterator<DataSourceConf> confsListIterator = confsList.iterator();
    while (confsListIterator.hasNext()) {
        DataSourceConf config = confsListIterator.next();
        if (config.isComplete()) {
            if (config.getSide() == Side.source) {
                haveSource = true;
            }
            if (config.getSide() == Side.destination) {
                haveDestination = true;
            }
        }
    }

    if (haveSource && haveDestination) {
        isConfComplete = true;
    }

    // Already have all the staff, or need launch UI and setup some more? 
    if (isConfComplete) {
        Converter cnv = new Converter(confsList);
        try {
            cnv.processConversion();
        } catch (Exception e) {
            LOG.error("Failed to convert. Parameters were: " + confsList.toString());
            e.printStackTrace();
            System.gc();
            System.exit(ErrorCodes.ErrorMisc.get());
        }
        System.gc(); // So that Heap/CPU Profiling Tool reports only live objects.
        System.exit(ErrorCodes.OK.get());
    } else {
        terminateConsoleLogging();
        System.setProperty("charva.color", "");
        MainFrame mainFrame = new MainFrame(confsList);
        mainFrame.show();
    }

}

From source file:Main.java

public static String dumpLuxLevel() {
    String result = "";
    if (mLevelSet == null)
        mLevelSet = mContext.getSharedPreferences(PREFER, Context.MODE_WORLD_READABLE).getStringSet(LEVELSET,
                null);//  ww w  . ja  v  a  2  s  .  co m
    if (mLevelSet != null) {
        ArrayList<String> array = Collections.list(Collections.enumeration(mLevelSet));
        Collections.sort(array, mComparator);
        result = array.toString();
    }
    return result;
}

From source file:com.sm.test.TestError.java

public static void testSplit() {
    ArrayList<String> list = new ArrayList<String>(Arrays.asList("1", "2", "3", "4", "5"));
    ArrayList<String> alist = new ArrayList<String>(Arrays.asList("1", "2", "3"));
    int j = list.size();
    list.removeAll(alist);/*from  www  .j  a v a  2s  .co  m*/
    System.out.println(list.toString() + " alist " + alist);
    String strToBytes = "strToBytes(\"00005d29e7918b7c9460a4c8496b8640\")";
    String[] splits = strToBytes.split("\"");
    System.out.println(splits[1].getBytes());
}

From source file:org.mustertech.webapp.vertxutils.JsonValidator.java

public static void validateJson(JsonSchema jsonSchemaNode, JsonNode jsonNode) throws ProcessingException {
    ProcessingReport report = jsonSchemaNode.validate(jsonNode);

    if (!report.isSuccess()) {
        ArrayList<String> errMesgs = new ArrayList<String>();

        for (ProcessingMessage processingMessage : report) {
            errMesgs.add(processingMessage.getMessage());
        }//from ww  w  .  j a  v a  2s . c om

        throw new ProcessingException(errMesgs.toString());
    }
}

From source file:com.genentech.chemistry.tool.sdfAggregator.SDFAggregator.java

private static String getGroupTagValue(OEGraphMol mol) {
    ArrayList<String> tagList = new ArrayList<String>();
    for (int i = 0; i < groups.size(); i++) {
        tagList.add(oechem.OEGetSDData(mol, groups.get(i)));
    }//  w w w . java2s. c om

    return tagList.toString();

}

From source file:eionet.cr.util.sesame.ResultCompareUtil.java

/**
 *
 * @param bs//from w w  w  . j ava  2 s  .  c  o m
 * @return
 */
private static String toString(BindingSet bs) {

    ArrayList<String> list = new ArrayList<String>();
    for (String name : bs.getBindingNames()) {
        list.add(bs.getValue(name).stringValue());
    }
    return list.toString();
}

From source file:org.rhq.modules.plugins.jbossas7.ModClusterContextDiscoveryComponent.java

/** Extracts the ProxyInformation details as returned by AS7 CLI.
 *  Assumes that result.getResult() is of type ArrayList.
 * @param result//from w  ww  .  ja v a2s .c o m
 * @return
 */
static String extractRawProxyInfo(Result result) {
    String rawProxyInfo = "";
    if (result != null && result.isSuccess()) {
        //in invalid type, log and bail.
        if (!(result.getResult() instanceof ArrayList)) {
            staticLogger.warn("Attempting to extract proxyInfo but JSON type information is not correct.");
            return rawProxyInfo;
        }

        //Extract just the values portion Ex. returns "{proxyList},{value}:
        ArrayList container = (ArrayList) result.getResult();
        if ((container != null) && !container.isEmpty()) {
            Object type = container.get(0);
            String values = "";
            if (type instanceof String) {
                //We only need the value element as the rest is extra.
                values += container.get(1);
            } else {
                values = container.toString();
            }
            rawProxyInfo = values;
        }
    }
    return rawProxyInfo;
}

From source file:Main.java

public static void invokeMethod(String paramString, Object paramObject, Object[] paramArrayOfObject)
        throws Exception {
    if (TextUtils.isEmpty(paramString))
        throw new RuntimeException("method name can not be empty");
    if (paramObject == null)
        throw new RuntimeException("target object can not be null");
    ArrayList localArrayList = new ArrayList();
    int i = paramArrayOfObject.length;
    for (int j = 0; j < i; j++)
        localArrayList.add(paramArrayOfObject[j].getClass());
    Method localMethod = paramObject.getClass().getDeclaredMethod(paramString,
            (Class[]) localArrayList.toArray());
    if (localMethod == null)
        throw new RuntimeException(
                "target object: " + paramObject.getClass().getName() + " do not have this method: "
                        + paramString + " with parameters: " + localArrayList.toString());
    localMethod.setAccessible(true);//ww  w.j  av  a  2s.com
    localMethod.invoke(paramObject, paramArrayOfObject);
}