diff options
| author | 2020-06-03 13:39:42 -0400 | |
|---|---|---|
| committer | 2020-06-03 18:39:42 +0100 | |
| commit | 0f47403d0220757fed189b76e2071e25b1025cb8 (patch) | |
| tree | 879bf72c4476f0a5e0d82da99d7ff2b2276bcaca /src/main/java/cuchaz/enigma/analysis/Access.java | |
| parent | Fix search dialog hanging for a short time sometimes (#250) (diff) | |
| download | enigma-fork-0f47403d0220757fed189b76e2071e25b1025cb8.tar.gz enigma-fork-0f47403d0220757fed189b76e2071e25b1025cb8.tar.xz enigma-fork-0f47403d0220757fed189b76e2071e25b1025cb8.zip | |
Split GUI code to separate module (#242)
* Split into modules
* Post merge compile fixes
Co-authored-by: modmuss50 <modmuss50@gmail.com>
Diffstat (limited to 'src/main/java/cuchaz/enigma/analysis/Access.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/analysis/Access.java | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/main/java/cuchaz/enigma/analysis/Access.java b/src/main/java/cuchaz/enigma/analysis/Access.java deleted file mode 100644 index 82ca669..0000000 --- a/src/main/java/cuchaz/enigma/analysis/Access.java +++ /dev/null | |||
| @@ -1,43 +0,0 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2015 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 4 | * are made available under the terms of the GNU Lesser General Public | ||
| 5 | * License v3.0 which accompanies this distribution, and is available at | ||
| 6 | * http://www.gnu.org/licenses/lgpl.html | ||
| 7 | * <p> | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | |||
| 12 | package cuchaz.enigma.analysis; | ||
| 13 | |||
| 14 | import cuchaz.enigma.translation.representation.AccessFlags; | ||
| 15 | |||
| 16 | import java.lang.reflect.Modifier; | ||
| 17 | |||
| 18 | public enum Access { | ||
| 19 | |||
| 20 | PUBLIC, PROTECTED, PACKAGE, PRIVATE; | ||
| 21 | |||
| 22 | public static Access get(AccessFlags flags) { | ||
| 23 | return get(flags.getFlags()); | ||
| 24 | } | ||
| 25 | |||
| 26 | public static Access get(int modifiers) { | ||
| 27 | boolean isPublic = Modifier.isPublic(modifiers); | ||
| 28 | boolean isProtected = Modifier.isProtected(modifiers); | ||
| 29 | boolean isPrivate = Modifier.isPrivate(modifiers); | ||
| 30 | |||
| 31 | if (isPublic && !isProtected && !isPrivate) { | ||
| 32 | return PUBLIC; | ||
| 33 | } else if (!isPublic && isProtected && !isPrivate) { | ||
| 34 | return PROTECTED; | ||
| 35 | } else if (!isPublic && !isProtected && isPrivate) { | ||
| 36 | return PRIVATE; | ||
| 37 | } else if (!isPublic && !isProtected && !isPrivate) { | ||
| 38 | return PACKAGE; | ||
| 39 | } | ||
| 40 | // assume public by default | ||
| 41 | return PUBLIC; | ||
| 42 | } | ||
| 43 | } | ||