public UniqueSearchIndex(Class<?> keyType, List<ITEM> items, Function<ITEM, KEY> keyGetter) { super(keyType); super.keyGetter = keyGetter; super.map = SPIFactory.getMapCreatorFactory().get().createMap(keyType); this.navigableMap = (NavigableMap<KEY, ITEM>) super.map; for (ITEM item : items) { add(item); } }
@Override public void init() { super.map = SPIFactory.getMapCreatorFactory().get().createNavigableMap(keyType, collator); this.navigableMap = (NavigableMap<KEY, ITEM>) super.map; }