# Class: com.pnfsoftware.jeb.util.collect.HashedList

A List type suitable for long lists of unique items for which [presence checks](#contains(Object)) are *often* required. For typical list implementations, [#contains(Object)](#contains(Object)) is in O\(N\) and therefore slow for long lists. 

 Limitations: Neither duplicate \(per `equals`\) nor null entries are allowed. Methods throw [NullPointerException](NullPointerException) on attempts to insert null entries, and [IllegalArgumentException](IllegalArgumentException) on attempts to insert duplicates. 

 This class is not thread\-safe. This class is serializable.

## Constructor: HashedList

Description: Construct an empty hashed\-list.

## Constructor: HashedList
- parameter: `initialCapacity`, type: `int`

Description: Construct an empty hashed\-list.
parameter: initialCapacity: initial capacity

## Constructor: HashedList
- parameter: `coll`, type: `java.util.Collection<? extends E>`

Description: Construct an empty hashed\-list from a source collection. The constructor will raise if null or duplicate entries are detected.
parameter: coll: source collection, which should not contain duplicates or null entries

## Constructor: HashedList
- parameter: `coll`, type: `java.util.Collection<? extends E>`
- parameter: `ignoreBadEntries`, type: `boolean`

Description: Construct an empty hashed\-list from a source collection.
parameter: coll: source collection, which should not contain duplicates or null entries
parameter: ignoreBadEntries: skip insertion of a null or a duplicate element

## Method: add
- parameter: `index`, type: `int`
- parameter: `element`, type: `E`


## Method: contains
- parameter: `o`, type: `java.lang.Object`
- return type: `boolean`

Description: Fast presence check, in O\(log N\) instead of O\(N\), the expected time complexity for search in a list.

## Method: containsAll
- parameter: `c`, type: `java.util.Collection<?>`
- return type: `boolean`

Description: Fast presence check, in O\(log N\) instead of O\(N\).

## Method: get
- parameter: `index`, type: `int`
- return type: `E`


## Method: remove
- parameter: `index`, type: `int`
- return type: `E`


## Method: set
- parameter: `index`, type: `int`
- parameter: `element`, type: `E`
- return type: `E`


## Method: size
- return type: `int`


## Static Method: createUnsafe
- parameter: `coll`, type: `java.util.Collection<? extends E>`
- return type: `com.pnfsoftware.jeb.util.collect.HashedList<E>`

Description: Fast construction of a HashedList: the source collection is not checked for null or duplicate entries. Usage is not recommended.
parameter: E: element type
parameter: coll: source collection, which should not contain duplicates or null entries
return: created hashed list

