blob: 13f634b64cc5bcbf709417807e03ab1ae212078b [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2005, 2007 IBM Corporation and others.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
*******************************************************************************/
package org.eclipse.dltk.core;
import org.eclipse.dltk.ast.Modifiers;
public class Flags implements Modifiers {
/**
* Returns whether the given integer includes the <code>private</code> modifier.
*
* @param flags the flags
* @return <code>true</code> if the <code>private</code> modifier is included
*/
public static boolean isPrivate(int flags) {
return (flags & AccPrivate) != 0;
}
/**
* Returns whether the given integer includes the <code>protected</code> modifier.
*
* @param flags the flags
* @return <code>true</code> if the <code>protected</code> modifier is included
*/
public static boolean isProtected(int flags) {
return (flags & AccProtected) != 0;
}
/**
* Returns whether the given integer includes the <code>public</code> modifier.
*
* @param flags the flags
* @return <code>true</code> if the <code>public</code> modifier is included
*/
public static boolean isPublic(int flags) {
return (flags & AccPublic) != 0;
}
/**
* Returns whether the given integer includes the <code>static</code> modifier.
*
* @param flags the flags
* @return <code>true</code> if the <code>static</code> modifier is included
*/
public static boolean isStatic(int flags) {
return (flags & AccStatic) != 0;
}
/**
* Returns whether the given integer includes the <code>final</code> modifier.
*
* @param flags the flags
* @return <code>true</code> if the <code>final</code> modifier is included
*/
public static boolean isFinal(int flags) {
return (flags & AccFinal) != 0;
}
/**
* Returns whether the given integer includes the <code>abstract</code> modifier.
*
* @param flags the flags
* @return <code>true</code> if the <code>abstract</code> modifier is included
*/
public static boolean isAbstract(int flags) {
return (flags & AccAbstract) != 0;
}
/**
* Returns whether the given integer includes the <code>interface</code> modifier.
*
* @param flags the flags
* @return <code>true</code> if the <code>interface</code> modifier is included
*/
public static boolean isInterface(int flags) {
return (flags & AccInterface) != 0;
}
/**
* Returns whether the given integer includes the indication that the
* element is synthetic.
*
* @param flags
* the flags
* @return <code>true</code> if the element is marked synthetic
* @since 2.0
*/
public static boolean isSynthetic(int flags) {
return (flags & AccSynthetic) != 0;
}
}