public class TypeImpl extends Object implements Type, Comparable<TypeImpl>
Modifier and Type | Field and Description |
---|---|
protected boolean |
isBuiltIn
when set, processing skipped for
- augment features from jcas
- conformance checking between jcas and type system
- validating the superclass chain upon load of jcas class
|
protected boolean |
isCreatableAndNotBuiltinArray
False for non creatable (as Feature Structures) values (e.g.
|
protected boolean |
isFeatureFinal |
protected boolean |
isInheritanceFinal |
protected boolean |
isLongOrDouble |
boolean |
isRefType
false for primitives, strings, string subtypes
|
protected Class<?> |
javaClass |
static TypeImpl |
singleton
A special instance used in CasCopier to identify a missing type
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(TypeImpl t)
compareTo must return 0 for "equal" types equal means same name, same flags, same supertype
chain, same subtypes, and same features Makes use of hashcodelong to probablistically shortcut
computation for equal case
for not equal types, do by parts
|
boolean |
equals(Object obj)
Equal TypeImpl.
|
Vector<Feature> |
getAppropriateFeatures()
Deprecated.
use
getFeatures() |
int |
getCode()
Return the internal integer code for this type.
|
SlotKinds.SlotKind |
getComponentSlotKind() |
TypeImpl |
getComponentType()
For array types, returns the component type of the array type.
|
Feature |
getFeature(String featureName)
Deprecated.
use getFeatureByBaseName instead
|
FeatureImpl |
getFeatureByBaseName(String featureShortName)
Retrieve a feature for this type.
|
FeatureImpl[] |
getFeatureImpls()
This impl depends on features never being removed from types, only added Minimal Java object
generation, maximal reuse
|
List<Feature> |
getFeatures()
guaranteed to be non-null, but might be empty list
|
Stream<FeatureImpl> |
getFeaturesAsStream() |
int |
getFsSpaceReq()
Get the v2 heap size for types with features
|
int |
getFsSpaceReq(int length)
get the v2 heap size for types
|
int |
getFsSpaceReq(TOP fs) |
String |
getJCasClassName() |
List<FeatureImpl> |
getMergedStaticFeaturesIntroducedByThisType() |
String |
getName()
Get the name of the type.
|
int |
getNbrOfLongOrDoubleFeatures() |
int |
getNumberOfFeatures()
Get the number of features for which this type defines the range.
|
String |
getShortName()
Get the unqualified, short name of this type.
|
TypeImpl |
getSuperType()
Get the super type.
|
TypeSystemImpl |
getTypeSystem()
Get the type hierarchy that this type belongs to.
|
int |
hashCode() |
long |
hashCodeNameLong() |
boolean |
hasRefFeature() |
boolean |
isAnnotationBaseType() |
boolean |
isAnnotationType()
Check if this is an annotation type.
|
boolean |
isAppropriateFeature(Feature feature) |
boolean |
isArray()
Check if the type is an array type.
|
boolean |
isCreatableAndNotBuiltinArray() |
boolean |
isFeatureFinal()
Check if type is feature final, i.e., if no more new features may be defined for it.
|
boolean |
isInheritanceFinal()
Check if type is inheritance final, i.e., if new types can be derived from it.
|
boolean |
isLongOrDouble() |
boolean |
isPrimitive()
Check if the type is one of the primitive types.
|
boolean |
isStringOrStringSubtype() |
boolean |
isStringSubtype()
Check if the type is a String subtype.
|
boolean |
isTopType() |
boolean |
isTypedFsArray() |
Iterator<Feature> |
iterator() |
void |
prettyPrint(StringBuilder sb,
int indent) |
void |
prettyPrintWithSubTypes(StringBuilder sb,
int indent) |
boolean |
subsumes(TypeImpl ti) |
boolean |
subsumesStrictly(TypeImpl ti) |
boolean |
subsumesValue(Object v) |
String |
toString() |
String |
toString(int indent) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected Class<?> javaClass
protected boolean isFeatureFinal
protected boolean isInheritanceFinal
protected final boolean isLongOrDouble
protected boolean isBuiltIn
protected final boolean isCreatableAndNotBuiltinArray
public final boolean isRefType
public static final TypeImpl singleton
public String getName()
public String getJCasClassName()
public TypeImpl getSuperType()
public int getCode()
>=0
.public String toString(int indent)
public void prettyPrint(StringBuilder sb, int indent)
public void prettyPrintWithSubTypes(StringBuilder sb, int indent)
@Deprecated public Vector<Feature> getAppropriateFeatures()
getFeatures()
getAppropriateFeatures
in interface Type
public int getNumberOfFeatures()
getNumberOfFeatures
in interface Type
public boolean isAppropriateFeature(Feature feature)
public boolean isAnnotationType()
true
, if this
is an annotation type or subtype;
false
, else.public boolean isAnnotationBaseType()
public boolean isCreatableAndNotBuiltinArray()
public TypeSystemImpl getTypeSystem()
public FeatureImpl getFeatureByBaseName(String featureShortName)
Type
getFeatureByBaseName
in interface Type
featureShortName
- The short, unqualified name of the feature.null
, else.Type.getFeatureByBaseName(String)
public String getShortName()
Type
getShortName
in interface Type
Type.getShortName()
public boolean isFeatureFinal()
Type
isFeatureFinal
in interface Type
Type.isFeatureFinal()
public boolean isInheritanceFinal()
Type
isInheritanceFinal
in interface Type
Type.isInheritanceFinal()
public boolean isLongOrDouble()
@Deprecated public Feature getFeature(String featureName)
featureName
- -public List<Feature> getFeatures()
getFeatures
in interface Type
public FeatureImpl[] getFeatureImpls()
public Stream<FeatureImpl> getFeaturesAsStream()
public List<FeatureImpl> getMergedStaticFeaturesIntroducedByThisType()
public boolean isPrimitive()
Type
isPrimitive
in interface Type
true
iff type is a primitive type.Type.isPrimitive()
public boolean isArray()
Type
isArray
in interface Type
true
iff the type is an array type.Type.isArray()
public boolean isStringSubtype()
Type
isStringSubtype
in interface Type
true
iff the type is a String subtype type; false for plain stringType.isStringSubtype()
public boolean isStringOrStringSubtype()
isStringOrStringSubtype
in interface Type
public TypeImpl getComponentType()
Type
null
.getComponentType
in interface Type
public SlotKinds.SlotKind getComponentSlotKind()
public boolean subsumes(TypeImpl ti)
ti
- the subtype to checkpublic boolean subsumesStrictly(TypeImpl ti)
ti
- the subtype to checkpublic boolean subsumesValue(Object v)
v
- the value to testpublic int getFsSpaceReq()
public int getFsSpaceReq(int length)
length
- for heap-stored arrays, the array lengthpublic int getFsSpaceReq(TOP fs)
public long hashCodeNameLong()
public boolean equals(Object obj)
public int compareTo(TypeImpl t)
compareTo
in interface Comparable<TypeImpl>
public boolean hasRefFeature()
public int getNbrOfLongOrDoubleFeatures()
public boolean isTypedFsArray()
public boolean isTopType()
Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.