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

Scala example source code file (GenericParamAndConstraints.java)

This example Scala source code file (GenericParamAndConstraints.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

constraints, constraints, genericparamandconstraints, mvar, mvar, name, name, noname, number, string, string, todo, tvars, type

The Scala GenericParamAndConstraints.java source code

package ch.epfl.lamp.compiler.msil;

/**
 * @author Miguel Garcia
 */
public class GenericParamAndConstraints {

    public GenericParamAndConstraints(int Number, String Name, Type[] Constraints,
                                      boolean isInvariant, boolean isCovariant, boolean isContravariant,
                                      boolean isReferenceType, boolean isValueType, boolean hasDefaultConstructor) {
        this.Number = Number;
        this.Name = Name;
        this.Constraints = Constraints; // TODO representation for the class and new() constraints missing 
        this.isInvariant = isInvariant;
        this.isCovariant = isCovariant;
        this.isContravariant = isContravariant;
        this.isReferenceType = isReferenceType;
        this.isValueType  = isValueType;
        this.hasDefaultConstructor = hasDefaultConstructor;

    }

    public final int Number;
    public final String Name; // can be null
    public final Type[] Constraints; // can be empty array
    public final boolean isInvariant; // only relevant for TVars, not for an MVar
    public final boolean isCovariant; // only relevant for TVars, not for an MVar
    public final boolean isContravariant; // only relevant for TVars, not for an MVar
    public final boolean isReferenceType;
    public final boolean isValueType;
    public final boolean hasDefaultConstructor;

    public String toString() {
        String res = Name == null ? "<NoName>" : (Name.equals("") ? "" : Name);
        res = res + " <: " + Constraints;
        return res;
    }

}

Other Scala examples (source code examples)

Here is a short list of links related to this Scala GenericParamAndConstraints.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.