APISonar


java.util.ArrayList.contains

> java > util > ArrayList > contains
java APIs util APIs ArrayList APIs contains APIs

Example 1
public void testValuesToArray() {
        ConcurrentNavigableMap map = map5();
        Collection v = map.values();
        Object[] ar = v.toArray();
        ArrayList s = new ArrayList(Arrays.asList(ar));
        assertEquals(5, ar.length);
        assertTrue(s.contains("A"));
        assertTrue(s.contains("B"));
        assertTrue(s.contains("C"));
        assertTrue(s.contains("D"));
        assertTrue(s.contains("E"));
    }
Example 2
private final ArrayList<T> _list;

  public boolean contains( T obj )
  {
    return _list.contains( obj );
  }
Example 3
private final ArrayList<E> list;

  public boolean contains(Object o) {
    //noinspection SuspiciousMethodCalls
    return list.contains(o);
  }
Example 4
private ArrayList myArrayList;

	public boolean contains(Object o) {
		// TODO Auto-generated method stub
		return myArrayList.contains(o);
	}
Example 5
private void verifyProtocols(ArrayList<String> protocolsList) {
        Assert.assertTrue(protocolsList.contains("TLSv1"));
        Assert.assertTrue(protocolsList.contains("TLSv1.1"));
        Assert.assertTrue(protocolsList.contains("TLSv1.2"));
        Assert.assertFalse(protocolsList.contains("SSLv3"));
        Assert.assertFalse(protocolsList.contains("SSLv2Hello"));
    }
Example 6
private ArrayList<E> backer;

  public boolean add(E e) {
    if(backer.contains(e))
      return false;
    else
      return backer.add(e);
  }
Example 7
protected ArrayList groups = new ArrayList();

    public boolean isInGroup(Group group) {

        synchronized (groups) {
            return (groups.contains(group));
        }

    }
Example 8
private final ArrayList<E> myList = new ArrayList<E>();

  public boolean add(E e) {
    if (!myList.contains(e)){
      myList.add(e);
      return true;
    }
    else{
      return false;
    }
  }
Example 9
private ArrayList<V> views;

    public void addView(V view) {
        if (!views.contains(view)) {
            views.add(view);
        }
    }
Example 10
private ArrayList<Object> mDispatchedObjects;

    public void dispatch() throws Exception {
        mLifecycle.addObserver(mObj1);
        mLifecycle.addObserver(mObj2);

        mLifecycle.dispatch(mDispatchedObjects::add);

        assertTrue(mDispatchedObjects.contains(mObj1));
        assertTrue(mDispatchedObjects.contains(mObj2));
    }
Example 11
private static ArrayList<Integer> usedNums;

    public static int getNewNextNum() {
        nextNum++;
        maxNum++;
        while (usedNums.contains(nextNum)) {
            nextNum++;
            maxNum++;
        }
        return nextNum;
    }
Example 12
private ArrayList<HDF4Product> productList;

    public boolean contains(Object o) {
        if (productList!=null)
            return productList.contains(o);
        return false;
    }
Example 13
public ArrayList<Long> blockedIds;

    public boolean isUserBlocked(Long userId) {
        try {
            return blockedIds.contains(userId);
        } catch (Exception e) {
            return false;
        }
    }
Example 14
private static ArrayList<Integer> used;

    public static int getCurrent() {
        current++;
        while (used.contains(current)) {
            current++;
        }
        return current;
    }
Example 15
private ArrayList<String> m_ports = new ArrayList<String>();

    public void addPort(String p) {
        if (p == null) {
            return;
        }
        if (!m_ports.contains(p)) {
            m_ports.add(p);
        }
    }
Example 16
private ArrayList<String> indexedInputs;

  public void addIndexedInput(String[] variables) {
    initIndexedVariables();
    for (String s : variables) {
      if (!indexedInputs.contains(s))
        indexedInputs.add(s);
    }
  }
Example 17
private static ArrayList<String> mExcludedApps = new ArrayList<String>();

    public static boolean isExcludedApp(String appName) {
        if (getPackagesCount() == 0) {
            return false;
        }

        if (!appName.endsWith(".apk")) {
            return mExcludedApps.contains(appName + ".apk");
        } else {
            return mExcludedApps.contains(appName);
        }
    }
Example 18
private ArrayList<Integer> claimedSet;

	void addClaimed(int pid) {
		if (!claimedSet.contains(pid)) {
			claimedSet.add(pid);
		}
	}
Example 19
protected ArrayList controllerListeners = new ArrayList();

	public void removeKeyListener(KeyListener listener) {
		keyListeners.remove(listener);
		keyListenersToAdd.remove(listener);
		
		if (!mouseListeners.contains(listener) && !controllerListeners.contains(listener)) {
			allListeners.remove(listener);
		}
	}
Example 20
public boolean previouslyMerged(ArrayList base, ArrayList merge) {

        return (base.contains(merge.get(0)));
    }
Example 21
public boolean existAnyRecording(ArrayList<String> idList){
		ArrayList<String> publishList=getAllRecordingIds(publishedDir);
		ArrayList<String> unpublishList=getAllRecordingIds(unpublishedDir);
		
		for(String id:idList){
			if(publishList.contains(id)||unpublishList.contains(id)){
				return true;
			}
		}
		return false;
	}
Example 22
protected ArrayList m_clauses = new ArrayList(2);

    public void set(Predicate[] p) {
        removeChildListeners();
        m_clauses.clear();
        for ( int i=0; i<p.length; ++i ) {
            if ( !m_clauses.contains(p) )
                m_clauses.add(p[i]);
        }
        if ( hasListeners() ) addChildListeners();
        fireExpressionChange();
    }
Example 23
transient protected ArrayList bcmListeners;

    public void addBeanContextMembershipListener(
            BeanContextMembershipListener listener) {
        if (listener == null) {
            throw new NullPointerException();
        }
        synchronized (bcmListeners) {
            if (!bcmListeners.contains(listener)) {
                bcmListeners.add(listener);
            }
        }
    }
Example 24
private ArrayList<String> mSuperPropertiesToFlag;

    public void addSuperPropertyToFlag(String superPropertyToFlag) {
        if (!mSuperPropertiesToFlag.contains(superPropertyToFlag)) {
            mSuperPropertiesToFlag.add(superPropertyToFlag);
        }
    }
Example 25
private ArrayList<Object> stopUnitList;

  public void removeFromStopUnitList(Object elem) {
    if (stopUnitList.contains(elem)) {
      stopUnitList.remove(elem);
    }
  }