APISonar


java.util.ArrayList.add

> java > util > ArrayList > add
java APIs util APIs ArrayList APIs add APIs

Example 1
public static List createSortedList() {
    ArrayList l = new ArrayList();
    l.add("a");
    l.add("b");
    l.add("c");
    return l;
  }
Example 2
private final ArrayList<Integer> mRsIndices = new ArrayList<>();

    private void pushIndices() {
        mXsIndices.add(mXsIndex);
        mYsIndices.add(mYsIndex);
        mDXsIndices.add(mDXsIndex);
        mDYsIndices.add(mDYsIndex);
        mRsIndices.add(mRsIndex);
    }
Example 3
public void write(ArrayList data)
	{
		data.add(xCoord);
		data.add(yCoord);
		data.add(zCoord);
		data.add(dimensionId);
	}
Example 4
private ArrayList<String> mImageUrlList = new ArrayList<>();

    public void addItem(int position, String imageUrl, int xOffset, int yOffset, int width,
            int height, String pageUrl) {
        mPositionList.add(position);
        mImageKeyList.add(getImageKey(imageUrl));
        mImageUrlList.add(imageUrl);
        mOffsetXList.add(xOffset);
        mOffsetYList.add(yOffset);
        mClipWidthList.add(width);
        mClipHeightList.add(height);
        mPageUrlList.add(pageUrl);
    }
Example 5
public Collection getContainerPropertyIds() {
        if (items.isEmpty()) {
            loadItems();
        }
        ArrayList a = new ArrayList();
        a.add(PROPERTY_1_ID);
        a.add(PROPERTY_2_ID);
        return a;
    }
Example 6
private ArrayList<Integer> idList;

    private void initStack() {
        for (int i = 0; i < feasize; i++) {
            idList.add(i);
            distanceList.add(0.0);
        }
    }
Example 7
public void testRIWithKeyListOnEmptyPrimaryOnPR()  throws Exception {
    ArrayList<String> riKeys = new ArrayList<String>();
    riKeys.add("KEY_0");
    riKeys.add("KEY_1");
    riKeys.add("KEY_2");
    riKeys.add("KEY_5");
    riKeys.add("KEY_6");
    riKeys.add("KEY_7");
    riKeys.add("KEY_9");
    
    doRegisterInterest(riKeys, null, numBuckets, false, true);
  }
Example 8
private ArrayList<Integer> anArrayList;

    public void setupDefaults() {
        anArrayList = new ArrayList<>();
        anArrayList.add(2);
        anArrayList.add(3);
        anArrayList.add(4);
    }
Example 9
public static List<Filter<String, String>> getOrderedList(){

        ArrayList<Filter<String, String>> ratios = new ArrayList<Filter<String, String>>();

        ratios.add(RATIO_ALL);
        ratios.add(RATIO_PORTRAIT);
        ratios.add(RATIO_4_3);
        ratios.add(RATIO_5_4);
        ratios.add(RATIO_16_9);
        ratios.add(RATIO_16_10);
        ratios.add(RATIO_32_9);
        ratios.add(RATIO_48_9);

        return ratios;
    }
Example 10
public static List<Filter<String, String>> getOrderedList(){

        ArrayList<Filter<String, String>> filters = new ArrayList<Filter<String, String>>();

        filters.add(TIMESPAN_24H);
        filters.add(TIMESPAN_3_DAYS);
        filters.add(TIMESPAN_1_WEEK);
        filters.add(TIMESPAN_2_WEEKS);
        filters.add(TIMESPAN_1_MONTH);
        filters.add(TIMESPAN_2_MONTHS);
        filters.add(TIMESPAN_3_MONTHS);
        filters.add(TIMESPAN_ALL_TIME);

        return filters;
    }
Example 11
protected ArrayList<String> fontAdapter;

	private void addFontSizePreset(String title, int small, int medium, int large) {
		fontSmall.add(small);
		fontMedium.add(medium);
		fontLarge.add(large);
		fontAdapter.add(title);
	}
Example 12
protected String[] getCodeGenArgs() {
    ArrayList<String> args = new ArrayList<String>();

    args.add("--table");
    args.add(getTableName());
    args.add("--connect");
    args.add(getConnectString());
    args.add("--hive-import");

    return args.toArray(new String[0]);
  }
Example 13
static ArrayList<Integer> colourArray = new ArrayList<Integer>();

	public static ArrayList<Integer> getColourArray() {
		colourArray.add(color.holo_blue_bright);
		colourArray.add(color.holo_blue_dark);
		colourArray.add(color.holo_blue_light);
		colourArray.add(color.holo_green_dark);
		colourArray.add(color.holo_green_light);
		colourArray.add(color.holo_orange_dark);
		colourArray.add(color.holo_orange_light);
		colourArray.add(color.holo_purple);
		colourArray.add(color.holo_red_dark);
		colourArray.add(color.holo_red_light);
		return colourArray;
	}
Example 14
public void testRouteWithTryCatchFinallyEndNoException() throws Exception {
        ArrayList<String> expected = new ArrayList<String>();
        expected.add("VALIDATE");
        expected.add("TO");
        expected.add("INVOKED2");
        expected.add("INVOKED3");

        runTest(createTryCatchFinallyEnd(), expected, "bar");
    }
Example 15
public static void createModularJar(String jarPath,
                                      String classesDir,
                                      String mainClass) throws Exception {
        ArrayList<String> argList = new ArrayList<String>();
        argList.add("--create");
        argList.add("--file=" + jarPath);
        if (mainClass != null) {
            argList.add("--main-class=" + mainClass);
        }
        argList.add("-C");
        argList.add(classesDir);
        argList.add(".");
        createJar(argList);
    }
Example 16
ArrayList<T> al = new ArrayList<T>();

  public void add(T o) {
    if (!map.containsKey(o)) {
      map.put(o, new Integer(nextIndex));
      al.add(o);
      nextIndex++;
    }
  }
Example 17
protected ArrayList<String> screenAdapter;

	private void addScreenSizePreset(int width, int height) {
		screenWidths.add(width);
		screenHeights.add(height);
		screenAdapter.add(width + " x " + height);
	}
Example 18
public void accessorWithABunchOfCalls() {
    uselessStaticMethod();
    ArrayList<String> myList = new ArrayList<String>();
    myList.add("Banana");
    myList.add("Peach");
    myList.add("Strawberry");
    
    firstNames.addAll(myList);
  }
Example 19
private final ArrayList<Callback> mEchoObservers = new ArrayList<>(1);

    private void manageObservers(Callback handler, boolean add) {
        synchronized (mEchoObservers) {
            if (add) {
                mEchoObservers.add(handler);
            } else {
                mEchoObservers.remove(handler);
            }
        }
    }
Example 20
private static List<String> getActionParameters()
   {
      ArrayList<String> params = new ArrayList<>();
      params.add(ACTION_PARAMETER);
      params.add(ID_PARAMETER);
      params.add(LAUNCHER_PARAMETER);
      return params;
   }
Example 21
public void add(int index, Object element) {

        if (fast) {
            synchronized (this) {
                ArrayList temp = (ArrayList) list.clone();
                temp.add(index, element);
                list = temp;
            }
        } else {
            synchronized (list) {
                list.add(index, element);
            }
        }

    }
Example 22
private final ArrayList<OpenType> itemTypes = new ArrayList<>();

    public void defineItem(String itemName, String itemDesc, OpenType itemType) {
        itemNames.add(itemName);
        itemDescriptions.add(itemDesc);
        itemTypes.add(itemType);
    }
Example 23
public static void main(String[] args) {
    ArrayList<String> names = new ArrayList<>();
    names.add("John");
    names.add("Paul");
    names.add("George");
    names.add("Ringo");

    Iterable<String> nameIterable = names;

    for (String name : nameIterable) {
      System.out.println(name);
    }
  }
Example 24
private ArrayList iElementPairs;

    private DateTimeFormatterBuilder append0(final Object element) {
        iFormatter = null;
        // Add the element as both a printer and parser.
        iElementPairs.add(element);
        iElementPairs.add(element);
        return this;
    }
Example 25
ArrayList<String> rowsArrayList = new ArrayList<>();

    private void populateData() {
        int i = 0;
        while (i < 10) {
            rowsArrayList.add("Item " + i);
            i++;
        }
    }