alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (MemberTypes.java)

This example Scala source code file (MemberTypes.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

constructor, constructor, custom, event, event, field, membertypes, method, method, nestedtype, property, typeinfo, typeinfo, unknown

The Scala MemberTypes.java source code

/*
 * System.Reflection-like API for access to .NET assemblies (DLL & EXE)
 */


package ch.epfl.lamp.compiler.msil;

/**
 * Marks each type of member that is defined as a derived class of MemberInfo.
 *
 * @author Nikolay Mihaylov
 * @version 1.0
 */
public final class MemberTypes {

    //##########################################################################

    /** Specifies that the member is a constructor,
     *  representing a ConstructorInfo member. */
    public static final int Constructor = 0x01;


    /** Specifies that the member is an event,
     *  representing an EventInfo member. */
    public static final int Event = 0x02;


    /** Specifies that the member is a field,
     *	representing a FieldInfo member. */
    public static final int Field = 0x04;


    /** Specifies that the member is a method,
     *  representing a MethodInfo member. */
    public static final int Method = 0x08;


    /** Specifies that the member is a property,
     *  representing a PropertyInfo member.
     */
    public static final int Property = 0x10;

    /** Specifies that the member is a type,
     *  representing a TypeInfo member. */
    public static final int TypeInfo = 0x20;


    /** Specifies that the member is a custom member type. */
    public static final int Custom = 0x40;


    /** Specifies that the member is a nested type,
     *  extending MemberInfo. */
    public static final int NestedType = 0x80;


    /** Specifies all member types. */
    public static final int All =
	Constructor | Event | Field | Method | Property | TypeInfo | NestedType;


    public static String toString(int memberType) {
	if ((memberType & Constructor) != 0) return "Constructor";
	if ((memberType & Event) != 0) return "Event";
	if ((memberType & Field) != 0) return "Field";
	if ((memberType & Method) != 0) return "Method";
	if ((memberType & Property) != 0) return "Property";
	if ((memberType & TypeInfo) != 0) return "TypeInfo";
	if ((memberType & Custom) != 0) return "Custom";
	if ((memberType & NestedType) != 0) return "NestedType";
	return "Unknown MemberType: " + memberType;
    }

    //##########################################################################

    // makes the class uninstantiable
    private MemberTypes() {}

    //##########################################################################

}  // class MemberTypes

Other Scala examples (source code examples)

Here is a short list of links related to this Scala MemberTypes.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.