Modifier and Type | Class and Description |
---|---|
static class |
SymbolTable.Kind
Represents
Declaration kind. |
Modifier and Type | Field and Description |
---|---|
List<Model> |
models
The list of models used to construct this symbol table.
|
Modifier and Type | Method and Description |
---|---|
Map<String,Pair<Feature,Attribute>> |
allAttributeMap(Iterable<String> featureNames)
Retrieves an immutable
Map of Member.name to
Attribute with its declaring Feature that contains all
declared and closest (least) inherited attributes of the provided features. |
Map<String,Pair<Feature,Attribute>> |
allAttributeMap(List<NamedType> namedTypes)
Retrieves an immutable
Map of Member.name to
Attribute with its declaring Feature that contains all
declared and closest (least) inherited attributes of the provided named
types. |
Map<String,Pair<Feature,Attribute>> |
allAttributeMap(String featureName)
Retrieves an immutable
Map of Member.name to
Attribute with its declaring Feature that contains all
declared and closest (least) inherited attributes of the provided feature. |
Set<Pair<Feature,Attribute>> |
allAttributes(Iterable<String> featureNames,
String attributeName,
boolean isOverriden)
|
Set<Pair<Feature,Attribute>> |
allAttributes(List<NamedType> namedTypes,
String attributeName,
boolean isOverriden)
|
Set<Pair<Feature,Attribute>> |
allAttributes(String featureName,
String attributeName,
boolean isOverriden)
|
Map<String,Pair<Feature,Invariant>> |
allInvariantMap(Iterable<String> featureNames)
Retrieves an immutable
Map of Member.name to
Invariant with its declaring Feature that contains all
declared and inherited invariants of the provided features. |
Map<String,Pair<Feature,Invariant>> |
allInvariantMap(List<NamedType> namedTypes)
Retrieves an immutable
Map of Member.name to
Invariant with its declaring Feature that contains all
declared and inherited invariants of the provided named types. |
Map<String,Pair<Feature,Invariant>> |
allInvariantMap(String featureName)
Retrieves an immutable
Map of Member.name to
Invariant with its declaring Feature that contains all
declared and inherited invariants of the provided feature. |
Map<String,Pair<Feature,Member>> |
allMemberMap(Iterable<String> featureNames)
Retrieves an immutable
Map of Member.name to Member
with its declaring Feature that contains all declared and closest
(least) inherited members of the provided features. |
Map<String,Pair<Feature,Member>> |
allMemberMap(List<NamedType> namedTypes)
Retrieves an immutable
Map of Member.name to Member
with its declaring Feature that contains all declared and inherited
closest (least) members of the provided named types. |
Map<String,Pair<Feature,Member>> |
allMemberMap(String featureName)
Retrieves an immutable
Map of Member.name to
Invariant with its declaring Feature that contains all
declared and closest (least) inherited members of the provided feature. |
BasicType |
basicType(String name)
Retrieves a
BasicType from its fully-qualified name (
Declaration.name ). |
Optional<BasicType> |
basicTypeOpt(String name)
Retrieves a
BasicType from its fully-qualified name (
Declaration.name ), if any. |
List<BasicType> |
basicTypes()
|
Map<String,Declaration> |
declarationMap()
Retrieves an immutable
Map of Declaration.name to
Declaration that contains all declarations in the models . |
Set<String> |
declarationNames()
|
Map<String,Attribute> |
declaredAttributeMap(String featureName)
Retrieves an immutable
Map of Member.name to
Attribute that contains all declared attributes of the provided
feature. |
Collection<Attribute> |
declaredAttributes(String featureName)
Retrieves an immutable
Collection of all declared Attribute
s of the provided feature. |
Map<String,Invariant> |
declaredInvariantMap(String featureName)
Retrieves an immutable
Map of Member.name to
Invariant that contains all declared invariants of the provided
feature. |
Collection<Invariant> |
declaredInvariants(String featureName)
Retrieves an immutable
Collection of all declared Invariant
s of the provided feature. |
Map<String,Member> |
declaredMemberMap(String featureName)
Retrieves an immutable
Map of Member.name to Member
that contains all declared members of the provided feature. |
Collection<Member> |
declaredMembers(String featureName)
Retrieves an immutable
Collection of all declared Member s
of the provided feature. |
Feature |
feature(String name)
Retrieves a
Feature from its fully-qualified name (
Declaration.name ). |
List<FeatureInit> |
featureInits()
Retrieves all
FeatureInit s declared in the models . |
Map<String,Map<String,Pair<Feature,Member>>> |
featureMemberMap()
Retrieves an immutable
Map of Declaration.name to Map
of Member.name to Member with its declaring Feature
that contains all features' and their declared and closest (least)
inherited members. |
Optional<Feature> |
featureOpt(String name)
Retrieves a
Feature from its fully-qualified name (
Declaration.name ), if any. |
List<Feature> |
features()
|
<V,T> Map<String,T> |
filter(Map<String,V> m,
Class<T> clazz)
|
<V,T> Map<String,Pair<Feature,T>> |
filterp(Map<String,Pair<Feature,V>> m,
Class<T> clazz)
|
boolean |
isBasicType(String name)
|
boolean |
isFeature(String name)
|
boolean |
isRequirement(String name)
|
boolean |
isSubTypeOf(String typeName,
String name)
|
boolean |
isSuperTypeOf(String typeName,
String name)
|
SymbolTable.Kind |
kind(String declarationName)
Retrieves the kind of a
Declaration . |
Optional<SymbolTable.Kind> |
kindOpt(String declarationName)
Retrieves the kind of a
Declaration , if any. |
static SymbolTable |
of(Model... models)
Creates a symbol table of the provided models.
|
List<RefinedType> |
refinedTypes()
Retrieves all
RefinedType s declared in the models . |
Requirement |
requirement(String name)
Retrieves a
Requirement from its fully-qualified name (
Declaration.name ). |
Optional<Requirement> |
requirementOpt(String name)
Retrieves a
Requirement from its fully-qualified name (
Declaration.name ), if any. |
List<Requirement> |
requirements()
Retrieves all
Requirement s declared in the models . |
Multimap<String,String> |
subTransitiveMap()
Retrieves a
Multimap that relates a super type's fully-qualified
name (either of Declaration.name or Declaration.name ) to its sub
type's fully-qualified name (either of Declaration.name or
Declaration.name ). |
Multimap<String,String> |
superTransitiveMap()
Retrieves a
Multimap that relates a sub type's fully-qualified name
(either of Declaration.name or Declaration.name ) to its super
type's fully-qualified name (either of Declaration.name or
Declaration.name ). |
String |
toString()
Returns the
String representation of this symbol table. |
public static SymbolTable of(Model... models)
models
- The models whose symbol table to be created.public Map<String,Pair<Feature,Attribute>> allAttributeMap(Iterable<String> featureNames)
Map
of Member.name
to
Attribute
with its declaring Feature
that contains all
declared and closest (least) inherited attributes of the provided features.featureNames
- The fully-qualified name (Declaration.name
) of the
Feature
s whose attributes to be retrieved.Map
.public Map<String,Pair<Feature,Attribute>> allAttributeMap(List<NamedType> namedTypes)
Map
of Member.name
to
Attribute
with its declaring Feature
that contains all
declared and closest (least) inherited attributes of the provided named
types.public Map<String,Pair<Feature,Attribute>> allAttributeMap(String featureName)
Map
of Member.name
to
Attribute
with its declaring Feature
that contains all
declared and closest (least) inherited attributes of the provided feature.featureName
- The fully-qualified name (Declaration.name
) of the
Feature
whose attributes to be retrieved.Map
.public Set<Pair<Feature,Attribute>> allAttributes(Iterable<String> featureNames, String attributeName, boolean isOverriden)
Set
of Attribute
with its declaring
Feature
that contains all overriden/overriding attributes of the
provided features and attribute name.featureNames
- The fully-qualified name (Declaration.name
) of the
Feature
s whose attributes to be retrieved.attributeName
- The Member.name
.isOverriden
- Indicates whether to retrieve overriden/overriding attributes.Set
.public Set<Pair<Feature,Attribute>> allAttributes(List<NamedType> namedTypes, String attributeName, boolean isOverriden)
Set
of Attribute
with its declaring
Feature
that contains all overriden/overriding attributes of the
provided named types and attribute name.namedTypes
- The NamedType
s referring to Feature
s whose
attributes to be retrieved.attributeName
- The Member.name
.isOverriden
- Indicates whether to retrieve overriden/overriding attributes.Set
.public Set<Pair<Feature,Attribute>> allAttributes(String featureName, String attributeName, boolean isOverriden)
Set
of Attribute
with its declaring
Feature
that contains all overriden/overriding attributes of the
provided named types and attribute name.featureName
- The fully-qualified name (Declaration.name
) of the
Feature
whose attributes to be retrieved.attributeName
- The Member.name
.isOverriden
- Indicates whether to retrieve overriden/overriding attributes.Set
.public Map<String,Pair<Feature,Invariant>> allInvariantMap(Iterable<String> featureNames)
Map
of Member.name
to
Invariant
with its declaring Feature
that contains all
declared and inherited invariants of the provided features.featureNames
- The fully-qualified name (Declaration.name
) of the
Feature
s whose invariants to be retrieved.Map
.public Map<String,Pair<Feature,Invariant>> allInvariantMap(List<NamedType> namedTypes)
Map
of Member.name
to
Invariant
with its declaring Feature
that contains all
declared and inherited invariants of the provided named types.public Map<String,Pair<Feature,Invariant>> allInvariantMap(String featureName)
Map
of Member.name
to
Invariant
with its declaring Feature
that contains all
declared and inherited invariants of the provided feature.featureName
- The fully-qualified name (Declaration.name
) of the
Feature
whose invariants to be retrieved.Map
.public Map<String,Pair<Feature,Member>> allMemberMap(Iterable<String> featureNames)
Map
of Member.name
to Member
with its declaring Feature
that contains all declared and closest
(least) inherited members of the provided features.featureNames
- The fully-qualified name (Declaration.name
) of the
Feature
s whose members to be retrieved.Map
.public Map<String,Pair<Feature,Member>> allMemberMap(List<NamedType> namedTypes)
Map
of Member.name
to Member
with its declaring Feature
that contains all declared and inherited
closest (least) members of the provided named types.public Map<String,Pair<Feature,Member>> allMemberMap(String featureName)
Map
of Member.name
to
Invariant
with its declaring Feature
that contains all
declared and closest (least) inherited members of the provided feature.featureName
- The fully-qualified name (Declaration.name
) of the
Feature
whose members to be retrieved.Map
.public BasicType basicType(String name)
BasicType
from its fully-qualified name (
Declaration.name
).public Optional<BasicType> basicTypeOpt(String name)
BasicType
from its fully-qualified name (
Declaration.name
), if any.public Map<String,Declaration> declarationMap()
Map
of Declaration.name
to
Declaration
that contains all declarations in the models
.Map
.public Map<String,Attribute> declaredAttributeMap(String featureName)
Map
of Member.name
to
Attribute
that contains all declared attributes of the provided
feature.featureName
- The fully-qualified name (Declaration.name
) of the
Feature
whose attributes to be retrieved.Map
.public Collection<Attribute> declaredAttributes(String featureName)
Collection
of all declared Attribute
s of the provided feature.featureName
- The fully-qualified name (Declaration.name
) of the
Feature
whose attributes to be retrieved.Collection
.public Map<String,Invariant> declaredInvariantMap(String featureName)
Map
of Member.name
to
Invariant
that contains all declared invariants of the provided
feature.featureName
- The fully-qualified name (Declaration.name
) of the
Feature
whose invariants to be retrieved.Map
.public Collection<Invariant> declaredInvariants(String featureName)
Collection
of all declared Invariant
s of the provided feature.featureName
- The fully-qualified name (Declaration.name
) of the
Feature
whose attributes to be retrieved.Collection
.public Map<String,Member> declaredMemberMap(String featureName)
Map
of Member.name
to Member
that contains all declared members of the provided feature.featureName
- The fully-qualified name (Declaration.name
) of the
Feature
whose members to be retrieved.Map
.public Collection<Member> declaredMembers(String featureName)
Collection
of all declared Member
s
of the provided feature.featureName
- The fully-qualified name (Declaration.name
) of the
Feature
whose members to be retrieved.Collection
.public Feature feature(String name)
Feature
from its fully-qualified name (
Declaration.name
).name
- The fully-qualified name (Declaration.name
) of the
Feature
.Feature
.{@link
- IllegalArgumentException} if the provided name is not a
Feature
in the models
.public List<FeatureInit> featureInits()
FeatureInit
s declared in the models
.List
.public Map<String,Map<String,Pair<Feature,Member>>> featureMemberMap()
Map
of Declaration.name
to Map
of Member.name
to Member
with its declaring Feature
that contains all features' and their declared and closest (least)
inherited members.Map
.public Optional<Feature> featureOpt(String name)
Feature
from its fully-qualified name (
Declaration.name
), if any.public <V,T> Map<String,T> filter(Map<String,V> m, Class<T> clazz)
Map
whose entries come from the provided
map where the entries' value is an instance of the provided Class
.m
- The map whose entries will be used to construct a filtered map
according to the provided class.clazz
- The class for filtering the provided map.Map
.public <V,T> Map<String,Pair<Feature,T>> filterp(Map<String,Pair<Feature,V>> m, Class<T> clazz)
Map
whose entries come from the provided
map where the entries' value's second element is an instance of the
provided Class
.m
- The map whose entries will be used to construct a filtered map
according to the provided class.clazz
- The class for filtering the provided map.Map
.public boolean isBasicType(String name)
name
- The fully-qualified name to query.BasicType
.public boolean isFeature(String name)
name
- The fully-qualified name to query.Feature
.public boolean isRequirement(String name)
name
- The fully-qualified name to query.Requirement
.public boolean isSubTypeOf(String typeName, String name)
BasicType
or a
Feature
is a sub type of another BasicType
or a
Feature
.typeName
- The fully-qualified name to query.name
- The fully-qualified name of a super type to query.public boolean isSuperTypeOf(String typeName, String name)
BasicType
or a
Feature
is a super type of another BasicType
or a
Feature
.typeName
- The fully-qualified name to query.name
- The fully-qualified name of a sub type to query.public SymbolTable.Kind kind(String declarationName)
Declaration
.declarationName
- The fully-qualified name (Declaration.name
) of the
Declaration
to query.SymbolTable.Kind
of the declaration.{@link
- IllegalArgumentException} if the provided declaration name
is not a Declaration
in the models
.public Optional<SymbolTable.Kind> kindOpt(String declarationName)
Declaration
, if any.declarationName
- The fully-qualified name (Declaration.name
) of the
Declaration
to query.SymbolTable.Kind
of the declaration, if found in models
.public List<RefinedType> refinedTypes()
RefinedType
s declared in the models
.List
.public Requirement requirement(String name)
Requirement
from its fully-qualified name (
Declaration.name
).name
- The fully-qualified name of the Requirement
.Requirement
.{@link
- IllegalArgumentException} if the provided name is not a
Requirement
in the models
.public Optional<Requirement> requirementOpt(String name)
Requirement
from its fully-qualified name (
Declaration.name
), if any.name
- The fully-qualified name to query.Requirement
, if found in models
.public List<Requirement> requirements()
Requirement
s declared in the models
.List
.public Multimap<String,String> subTransitiveMap()
Multimap
that relates a super type's fully-qualified
name (either of Declaration.name
or Declaration.name
) to its sub
type's fully-qualified name (either of Declaration.name
or
Declaration.name
).Multimap
.public Multimap<String,String> superTransitiveMap()
Multimap
that relates a sub type's fully-qualified name
(either of Declaration.name
or Declaration.name
) to its super
type's fully-qualified name (either of Declaration.name
or
Declaration.name
).Multimap
.