Java ArrayList Create getArrayList(Map map, Object obj)

Here you can find the source of getArrayList(Map map, Object obj)

Description

get Array List

License

Open Source License

Declaration

public static ArrayList getArrayList(Map map, Object obj) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2007, 2008 Intel Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:/*from   ww  w  .  j a v a  2 s  .c  o  m*/
 * Intel Corporation - Initial API and implementation
 *******************************************************************************/

import java.util.ArrayList;

import java.util.Map;

public class Main {
    public static ArrayList getArrayList(Map map, Object obj) {
        ArrayList list = (ArrayList) map.get(obj);
        if (list == null) {
            list = new ArrayList();
            map.put(obj, list);
        }
        return list;
    }
}

Related

  1. getArrayList()
  2. getArrayList()
  3. getArrayList()
  4. getArrayList(final Object o, final Class clazz)
  5. getArrayList(List list)
  6. getArrayList(String[] args)
  7. getArrayListForArray(Object[] rowData)
  8. getArrayListFromInt(int number)
  9. getArrayListFromString(String wordSequence, String separator)