APISonar


java.util.ArrayList.hashCode

> java > util > ArrayList > hashCode
java APIs util APIs ArrayList APIs hashCode APIs

Example 1
private final ArrayList<T> _list;

  public int hashCode()
  {
    return _list.hashCode();
  }
Example 2
private ArrayList<Integer> positions = new ArrayList<>();

    public int hashCode() {
        return classHash()
                ^ slop
                ^ termArraysHashCode()
                ^ positions.hashCode();
    }
Example 3
private ArrayList<String> mMccMncs;

    public int hashCode () {
        return ((mScanType * 31)
                + (Arrays.hashCode(mSpecifiers)) * 37
                + (mSearchPeriodicity * 41)
                + (mMaxSearchTime * 43)
                + ((mIncrementalResults == true? 1 : 0) * 47)
                + (mIncrementalResultsPeriodicity * 53)
                + (mMccMncs.hashCode() * 59));
    }
Example 4
private ArrayList<State> states = null;

    public int hashCode() {
      return 31 * (Arrays.hashCode(isyms) +
             31 * (Arrays.hashCode(osyms) +
             31 * ((start == null ? 0 : start.hashCode()) +
             31 * ((states == null ? 0 : states.hashCode()) +
             31 * ((semiring == null ? 0 : semiring.hashCode()))))));
    }
Example 5
private ArrayList disjuncts = new ArrayList();

  public int hashCode() {
    return Float.floatToIntBits(getBoost())
            + Float.floatToIntBits(tieBreakerMultiplier)
            + disjuncts.hashCode();
  }
Example 6
public static int hashCode(List list) {
        if ( list == null ) {
            return 0;
        }
        if ( list.isEmpty() ) {
            return 1;
        }
        ArrayList<?> tmp = new ArrayList<>(list);
        Collections.sort(tmp, (o1, o2) -> Integer.compare(o1.hashCode(), o2.hashCode()));
        return tmp.hashCode();
    }
Example 7
public void hashCode_allObjects() {
        ArrayList<AllJavaTypes> newList = new ArrayList<AllJavaTypes>();
        newList.addAll(collection);

        assertTrue(collection.hashCode() == newList.hashCode());
        assertFalse(collection.hashCode() == Collections.emptyList().hashCode());
    }
Example 8
ArrayList mustFilters = null;

  public int hashCode()
  {
    int hash=7;
    hash = 31 * hash + (null == mustFilters ? 0 : mustFilters.hashCode());
    hash = 31 * hash + (null == notFilters ? 0 : notFilters.hashCode());
    hash = 31 * hash + (null == shouldFilters ? 0 : shouldFilters.hashCode());
    return hash;
  }
Example 9
public void shouldEqualsAndHashcode()
    {
        final ArrayList<Integer> genericList = new ArrayList<>();
        final int count = 20;

        for (int i = 0; i < count; i++)
        {
            list.addInt(i);
            genericList.add(i);
        }

        assertEquals(genericList.hashCode(), list.hashCode());
        assertEquals(genericList, list);
        assertEquals(list, genericList);
    }
Example 10
public final ArrayList<ATNConfig> configs = new ArrayList<ATNConfig>(7);

	public int hashCode() {
		if (isReadonly()) {
			if (cachedHashCode == -1) {
				cachedHashCode = configs.hashCode();
			}

			return cachedHashCode;
		}

		return configs.hashCode();
	}
Example 11
public int hashCode() {
        ArrayList<Object> objectList = new ArrayList<Object>();
        objectList.add(mRequestType);
        for (int i = 0, length = mParamList.size(); i < length; i++) {
            objectList.add(mBundle.get(mParamList.get(i)));
        }
        return objectList.hashCode();
    }
Example 12
public void testEqualsAndHashCode() throws Exception {
    ModifyAwareList<String> listA = createEmptyList();
    ArrayList<String> listB = new ArrayList<>();

    assertThat(listA).isEqualTo(listB);
    assertThat(listA.hashCode()).isEqualTo(listB.hashCode());

    listA.add("foo");
    assertThat(listA).isNotEqualTo(listB);
    assertThat(listA.hashCode()).isNotEqualTo(listB.hashCode());

    listB.add("foo");
    assertThat(listA).isEqualTo(listB);
    assertThat(listA.hashCode()).isEqualTo(listB.hashCode());
  }
Example 13
private ArrayList<Surface> mSurfaces;

    public int hashCode() {
        // Need ensure that the hashcode remains unchanged after adding a deferred surface. Otherwise
        // the deferred output configuration will be lost in the camera streammap after the deferred
        // surface is set.
        if (mIsDeferredConfig) {
            return HashCodeHelpers.hashCode(
                    mRotation, mConfiguredSize.hashCode(), mConfiguredFormat, mConfiguredDataspace,
                    mSurfaceGroupId, mSurfaceType, mIsShared ? 1 : 0);
        }

        return HashCodeHelpers.hashCode(
                mRotation, mSurfaces.hashCode(), mConfiguredGenerationId,
                mConfiguredSize.hashCode(), mConfiguredFormat,
                mConfiguredDataspace, mSurfaceGroupId, mIsShared ? 1 : 0);
    }
Example 14
protected ArrayList<ID3v2Frame> subframes = new ArrayList<>();

	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + Arrays.hashCode(children);
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + (isOrdered ? 1231 : 1237);
		result = prime * result + (isRoot ? 1231 : 1237);
		result = prime * result
				+ ((subframes == null) ? 0 : subframes.hashCode());
		return result;
	}
Example 15
private ArrayList<Song> mSongs = new ArrayList<Song>(12);

	private void changed()
	{
		// Invalidate shuffle cache if the timeline *contents* changed in the meantime
		if (mShuffleCache != null && mShuffleTicket != mSongs.hashCode())
			mShuffleCache = null;

		if (mCallback != null)
			mCallback.timelineChanged();
	}
Example 16
private static boolean areCriteriaEquivalent(ArrayList<AudioMixMatchCriterion> cr1,
            ArrayList<AudioMixMatchCriterion> cr2) {
        if (cr1 == null || cr2 == null) return false;
        if (cr1 == cr2) return true;
        if (cr1.size() != cr2.size()) return false;
        //TODO iterate over rules to check they contain the same criterion
        return (cr1.hashCode() == cr2.hashCode());
    }
Example 17
private ArrayList<Song> mSongs = new ArrayList<Song>(12);

	private ArrayList<Song> getShuffledTimeline(boolean cached)
	{
		if (cached == false)
			mShuffleCache = null;

		if (mShuffleCache == null) {
			ArrayList<Song> songs = new ArrayList<Song>(mSongs);
			MediaUtils.shuffle(songs, mShuffleMode == SHUFFLE_ALBUMS);
			mShuffleCache = songs;
			mShuffleTicket = mSongs.hashCode();
		}
		return new ArrayList<Song>(mShuffleCache);
	}