// 
// Decompiled by Procyon v0.6.0
// 

package ch.randelshofer.fastdoubleparser.bte;

import java.util.Iterator;
import java.util.Arrays;
import java.nio.charset.StandardCharsets;
import java.util.Set;

final class ByteSetOfFew implements ByteSet
{
    private final byte[] bytes;
    
    public ByteSetOfFew(final Set<Character> set) {
        final byte[] tmp = new byte[set.size() * 4];
        int i = 0;
        for (final char ch : set) {
            for (final byte b : String.valueOf(ch).getBytes(StandardCharsets.UTF_8)) {
                tmp[i++] = b;
            }
        }
        this.bytes = Arrays.copyOf(tmp, i);
    }
    
    @Override
    public boolean containsKey(final byte b) {
        boolean found = false;
        for (final byte aChar : this.bytes) {
            found |= (aChar == b);
        }
        return found;
    }
}
