Top Description Inners Fields Constructors Methods
com.github.javaparser.ast.type

public Class PrimitiveType

extends Type
implements NodeWithAnnotations<PrimitiveType>
Class Inheritance
All Implemented Interfaces
com.github.javaparser.ast.nodeTypes.NodeWithAnnotations
Imports
com.github.javaparser.ast.AllFieldsConstructor, .NodeList, .Node, .Generated, com.github.javaparser.ast.expr.AnnotationExpr, com.github.javaparser.ast.nodeTypes.NodeWithAnnotations, com.github.javaparser.ast.observer.ObservableProperty, com.github.javaparser.ast.visitor.GenericVisitor, .VoidVisitor, .CloneVisitor, java.util.HashMap, .Optional, com.github.javaparser.metamodel.PrimitiveTypeMetaModel, .JavaParserMetaModel, com.github.javaparser.TokenRange, com.github.javaparser.resolution.types.ResolvedPrimitiveType, java.util.function.Consumer

A primitive type.
int
boolean
short
Author
Julio Vilmar Gesser

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
private PrimitiveType.Primitive
pack-priv static final HashMap<String, PrimitiveType.Primitive>

Constructor Summary

AccessConstructor and Description
public
public
public
public
PrimitiveType(TokenRange tokenRange, PrimitiveType.Primitive type, NodeList<AnnotationExpr> annotations)

This constructor is used by the parser and is considered private.

Method Summary

Modifier and TypeMethod and Description
public <R, A> R
accept(final GenericVisitor<R, A>
the visitor implementation
v
,
final A
the argument passed to the visitor (of type A)
arg
)

Implements com.github.javaparser.ast.visitor.Visitable.accept.

Accept method for visitor support.
public <A> void
accept(final VoidVisitor<A>
the visitor implementation
v
,
final A
any value relevant for the visitor (of type A)
arg
)

Implements com.github.javaparser.ast.visitor.Visitable.accept.

Accept method for visitor support.
public PrimitiveType
public String
public static PrimitiveType
public static PrimitiveType
public static PrimitiveType
public PrimitiveType
clone()

Overrides com.github.javaparser.ast.type.Type.clone.

Creates and returns a copy of this object.
public static PrimitiveType
public static PrimitiveType
public PrimitiveTypeMetaModel
public PrimitiveType.Primitive
public void
public static PrimitiveType
public boolean
public static PrimitiveType
public boolean
public boolean
public ResolvedPrimitiveType
public PrimitiveType
public PrimitiveType
public static PrimitiveType
public ClassOrInterfaceType
public Optional<PrimitiveType>
Inherited from com.github.javaparser.ast.type.Type:
asArrayTypeasClassOrInterfaceTypeasIntersectionTypeasReferenceTypeasTypeParameterasUnionTypeasUnknownTypeasVarTypeasVoidTypeasWildcardTypegetAnnotationgetAnnotationsgetArrayLevelgetElementTypeifArrayTypeifClassOrInterfaceTypeifIntersectionTypeifReferenceTypeifTypeParameterifUnionTypeifUnknownTypeifVarTypeifVoidTypeifWildcardTypeisArrayTypeisClassOrInterfaceTypeisIntersectionTypeisReferenceTypeisTypeParameterisUnionTypeisUnknownTypeisVarTypeisVoidTypeisWildcardTypetoArrayTypetoClassOrInterfaceTypetoIntersectionTypetoReferenceTypetoTypeParametertoUnionTypetoUnknownTypetoVarTypetoVoidTypetoWildcardType

Field Detail

typeback to summary
private PrimitiveType.Primitive type
unboxMapback to summary
pack-priv static final HashMap<String, PrimitiveType.Primitive> unboxMap

Constructor Detail

PrimitiveTypeback to summary
public PrimitiveType()
PrimitiveTypeback to summary
public PrimitiveType(final PrimitiveType.Primitive type)
PrimitiveTypeback to summary
public PrimitiveType(final PrimitiveType.Primitive type, NodeList<AnnotationExpr> annotations)
Annotations
@AllFieldsConstructor
PrimitiveTypeback to summary
public PrimitiveType(TokenRange tokenRange, PrimitiveType.Primitive type, NodeList<AnnotationExpr> annotations)

This constructor is used by the parser and is considered private.

Annotations
@Generated:com.github.javaparser.generator.core.node.MainConstructorGenerator

Method Detail

acceptback to summary
public <R, A> R accept(final GenericVisitor<R, A> v, final A arg)

Implements com.github.javaparser.ast.visitor.Visitable.accept.

Doc from com.github.javaparser.ast.visitor.Visitable.accept.

Accept method for visitor support.

Parameters
<R>
the type of the return value of the visitor
<A>
the type the user argument passed to the visitor
v:GenericVisitor<R, A>

the visitor implementation

arg:A

the argument passed to the visitor (of type A)

Returns:R

the result of the visit (of type R)

Annotations
@Override
@Generated:com.github.javaparser.generator.core.node.AcceptGenerator
acceptback to summary
public <A> void accept(final VoidVisitor<A> v, final A arg)

Implements com.github.javaparser.ast.visitor.Visitable.accept.

Doc from com.github.javaparser.ast.visitor.Visitable.accept.

Accept method for visitor support.

Parameters
<A>
the type the argument passed for the visitor
v:VoidVisitor<A>

the visitor implementation

arg:A

any value relevant for the visitor (of type A)

Annotations
@Override
@Generated:com.github.javaparser.generator.core.node.AcceptGenerator
asPrimitiveTypeback to summary
public PrimitiveType asPrimitiveType()

Overrides com.github.javaparser.ast.type.Type.asPrimitiveType.

Annotations
@Override
@Generated:com.github.javaparser.generator.core.node.TypeCastingGenerator
asStringback to summary
public String asString()

Implements abstract com.github.javaparser.ast.type.Type.asString.

Annotations
@Override
booleanTypeback to summary
public static PrimitiveType booleanType()
byteTypeback to summary
public static PrimitiveType byteType()
charTypeback to summary
public static PrimitiveType charType()
cloneback to summary
public PrimitiveType clone()

Overrides com.github.javaparser.ast.type.Type.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:PrimitiveType

a clone of this instance.

Annotations
@Override
@Generated:com.github.javaparser.generator.core.node.CloneGenerator
doubleTypeback to summary
public static PrimitiveType doubleType()
floatTypeback to summary
public static PrimitiveType floatType()
getMetaModelback to summary
public PrimitiveTypeMetaModel getMetaModel()

Overrides com.github.javaparser.ast.type.Type.getMetaModel.

Returns:PrimitiveTypeMetaModel

Doc from com.github.javaparser.ast.Node.getMetaModel.

get JavaParser specific node introspection information.

Annotations
@Override
@Generated:com.github.javaparser.generator.core.node.GetMetaModelGenerator
getTypeback to summary
public PrimitiveType.Primitive getType()
Annotations
@Generated:com.github.javaparser.generator.core.node.PropertyGenerator
ifPrimitiveTypeback to summary
public void ifPrimitiveType(Consumer<PrimitiveType> action)

Overrides com.github.javaparser.ast.type.Type.ifPrimitiveType.

Annotations
@Generated:com.github.javaparser.generator.core.node.TypeCastingGenerator
intTypeback to summary
public static PrimitiveType intType()
isPrimitiveTypeback to summary
public boolean isPrimitiveType()

Overrides com.github.javaparser.ast.type.Type.isPrimitiveType.

Annotations
@Override
@Generated:com.github.javaparser.generator.core.node.TypeCastingGenerator
longTypeback to summary
public static PrimitiveType longType()
removeback to summary
public boolean remove(Node node)

Overrides com.github.javaparser.ast.type.Type.remove.

Annotations
@Override
@Generated:com.github.javaparser.generator.core.node.RemoveMethodGenerator
replaceback to summary
public boolean replace(Node node, Node replacementNode)

Overrides com.github.javaparser.ast.type.Type.replace.

Annotations
@Override
@Generated:com.github.javaparser.generator.core.node.ReplaceMethodGenerator
resolveback to summary
public ResolvedPrimitiveType resolve()

Implements abstract com.github.javaparser.ast.type.Type.resolve.

Implements com.github.javaparser.resolution.Resolvable.resolve.

Annotations
@Override
setAnnotationsback to summary
public PrimitiveType setAnnotations(NodeList<AnnotationExpr> annotations)

Overrides com.github.javaparser.ast.type.Type.setAnnotations.

Implements com.github.javaparser.ast.nodeTypes.NodeWithAnnotations.setAnnotations.

Annotations
@Override
setTypeback to summary
public PrimitiveType setType(final PrimitiveType.Primitive type)
Annotations
@Generated:com.github.javaparser.generator.core.node.PropertyGenerator
shortTypeback to summary
public static PrimitiveType shortType()
toBoxedTypeback to summary
public ClassOrInterfaceType toBoxedType()
toPrimitiveTypeback to summary
public Optional<PrimitiveType> toPrimitiveType()

Overrides com.github.javaparser.ast.type.Type.toPrimitiveType.

Annotations
@Override
@Generated:com.github.javaparser.generator.core.node.TypeCastingGenerator
com.github.javaparser.ast.type back to summary

public final Enum PrimitiveType.Primitive

extends Enum<PrimitiveType.Primitive>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final PrimitiveType.Primitive
public static final PrimitiveType.Primitive
public static final PrimitiveType.Primitive
private String
public static final PrimitiveType.Primitive
public static final PrimitiveType.Primitive
public static final PrimitiveType.Primitive
public static final PrimitiveType.Primitive
pack-priv final String
public static final PrimitiveType.Primitive

Constructor Summary

AccessConstructor and Description
private
Primitive(String nameOfBoxedType)

Method Summary

Modifier and TypeMethod and Description
public String
public ClassOrInterfaceType
public static PrimitiveType.Primitive
public static PrimitiveType.Primitive[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BOOLEANback to summary
public static final PrimitiveType.Primitive BOOLEAN
BYTEback to summary
public static final PrimitiveType.Primitive BYTE
CHARback to summary
public static final PrimitiveType.Primitive CHAR
codeRepresentationback to summary
private String codeRepresentation
DOUBLEback to summary
public static final PrimitiveType.Primitive DOUBLE
FLOATback to summary
public static final PrimitiveType.Primitive FLOAT
INTback to summary
public static final PrimitiveType.Primitive INT
LONGback to summary
public static final PrimitiveType.Primitive LONG
nameOfBoxedTypeback to summary
pack-priv final String nameOfBoxedType
SHORTback to summary
public static final PrimitiveType.Primitive SHORT

Constructor Detail

Primitiveback to summary
private Primitive(String nameOfBoxedType)

Method Detail

asStringback to summary
public String asString()
toBoxedTypeback to summary
public ClassOrInterfaceType toBoxedType()
valueOfback to summary
public static PrimitiveType.Primitive valueOf(String name)
valuesback to summary
public static PrimitiveType.Primitive[] values()