@@ -0,0 +1,1175 @@
+package edu.mit.streamjit.impl.compiler;%0A%0Aimport com.google.common.collect.ImmutableSet;%0Aimport com.google.common.collect.Sets;%0Aimport java.util.Arrays;%0Aimport java.util.Set;%0A%0A/**%0A * Represents an access kind.%0A * @author Jeffrey Bosboom %3Cjeffreybosboom@gmail.com%3E%0A * @since 4/3/2013%0A */%0Apublic enum Access %7B%0A%09PUBLIC(Modifier.PUBLIC), PROTECTED(Modifier.PROTECTED),%0A%09PACKAGE_PRIVATE(), PRIVATE(Modifier.PRIVATE);%0A%09private static final ImmutableSet%3CModifier%3E ACCESS_MODIFIERS =%0A%09%09%09Sets.immutableEnumSet(Modifier.PUBLIC, Modifier.PROTECTED, Modifier.PRIVATE);%0A%09private final ImmutableSet%3CModifier%3E modifiers;%0A%09private Access(Modifier... modifiers) %7B%0A%09%09this.modifiers = Sets.immutableEnumSet(Arrays.asList(modifiers));%0A%09%7D%0A%0A%09public ImmutableSet%3CModifier%3E modifiers() %7B%0A%09%09return modifiers;%0A%09%7D%0A%0A%09public static Access fromModifiers(Set%3CModifier%3E modifiers) %7B%0A%09%09Set%3CModifier%3E active = Sets.intersection(allAccessModifiers(), modifiers);%0A%09%09for (Access a : values())%0A%09%09%09if (active.equals(a.modifiers()))%0A%09%09%09%09return a;%0A%09%09throw new IllegalArgumentException(%22bad access modifiers: %22+active);%0A%09%7D%0A%0A%09public static ImmutableSet%3CModifier%3E allAccessModifiers() %7B%0A%09%09return ACCESS_MODIFIERS;%0A%09%7D%0A%7D%0A

Access enum