Sha256: 3d8599c1b1f9824ee8f322a3580c17472d920af1497750ffcc6a2391f5a5be8f

Contents?: true

Size: 1.41 KB

Versions: 12

Compression:

Stored size: 1.41 KB

Contents

package org.cx4a.rsense.typing.annotation;

import java.util.List;

public class ClassType implements TypeAnnotation {
    private String name;
    private List<TypeVariable> types;
    private List<TypeConstraint> constraints;
    private List<TypePragma> pragmas;
    
    public ClassType(String name, List<TypeVariable> types, List<TypeConstraint> constraints, List<TypePragma> pragmas) {
        this.name = name;
        this.types = types;
        this.constraints = constraints;
        this.pragmas = pragmas;
    }

    public String getName() {
        return name;
    }

    public List<TypeVariable> getTypes() {
        return types;
    }

    public List<TypeConstraint> getConstraints() {
        return constraints;
    }

    public List<TypePragma> getPragmas() {
        return pragmas;
    }

    public boolean containsType(TypeVariable type) {
        return types != null && types.indexOf(type) != -1;
    }

    public boolean isNoBody() {
        if (pragmas != null) {
            for (TypePragma pragma : pragmas) {
                if (pragma.getType() == TypeExpression.Type.NOBODY_PRAGMA) {
                    return true;
                }
            }
        }
        return false;
    }

    public boolean isPolymorphic() {
        return types != null;
    }

    @Override
    public String toString() {
        return "<ClassType " + name + " " + types + " " + constraints + " " + pragmas + ">";
    }
}

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rsense-core-0.6.6 src/org/cx4a/rsense/typing/annotation/ClassType.java
rsense-core-0.6.5 src/org/cx4a/rsense/typing/annotation/ClassType.java
rsense-core-0.6.4 src/org/cx4a/rsense/typing/annotation/ClassType.java
rsense-core-0.6.2 src/org/cx4a/rsense/typing/annotation/ClassType.java
rsense-core-0.6.1 src/org/cx4a/rsense/typing/annotation/ClassType.java
rsense-core-0.6.0 src/org/cx4a/rsense/typing/annotation/ClassType.java
rsense-core-0.5.9 src/org/cx4a/rsense/typing/annotation/ClassType.java
rsense-core-0.5.8 src/org/cx4a/rsense/typing/annotation/ClassType.java
rsense-core-0.5.6 src/org/cx4a/rsense/typing/annotation/ClassType.java
rsense-core-0.5.2 src/org/cx4a/rsense/typing/annotation/ClassType.java
rsense-core-0.5.1 src/org/cx4a/rsense/typing/annotation/ClassType.java
rsense-core-0.5.0 src/org/cx4a/rsense/typing/annotation/ClassType.java