package org.xbib.datastructures.immutable;

final class RegularImmutableMapKeySet<K> extends IndexedImmutableSet<K> {
    private final RegularImmutableMap<K, ?> map;

    RegularImmutableMapKeySet(RegularImmutableMap<K, ?> map) {
        this.map = map;
    }

    @Override
    K get(int index) {
        return map.entries[index].getKey();
    }

    @Override
    public boolean contains(Object object) {
        return map.containsKey(object);
    }

    @Override
    boolean isPartialView() {
        return true;
    }

    @Override
    public int size() {
        return map.size();
    }
}
