Modifier and Type | Method and Description |
---|---|
static List<AstAbstractClafer> |
getAbstractClafersInSubOrder(AstModel model)
Find the abstract Clafers such that the subclafers appear before the
super clafers.
|
static List<AstClafer> |
getClafers(AstModel model)
Find all the nested Clafers in no specific order.
|
static List<Set<AstClafer>> |
getClafersInParentAndSubOrder(AstModel model)
Find the Clafers such that the parents appear before the children, and
the subclafers appear before the superclafers.
|
static List<AstConcreteClafer> |
getConcreteClafers(AstModel model)
Find all the nested concrete Clafers in no specific order.
|
static List<AstConcreteClafer> |
getConcreteClafersInParentOrder(AstModel model)
Find the concrete Clafers such that the parents appear before the
children.
|
static List<AstConcreteClafer> |
getConcreteSubs(AstClafer clafer)
Find all the concrete subtypes of the supplied Clafer, including itself
if it is concrete.
|
static AstRef |
getInheritedRef(AstClafer clafer)
Find the reference belonging to the Clafer or the reference it inherited.
|
static AstClafer |
getLowestCommonSupertype(AstClafer... unionType)
Finds the lowest common supertype.
|
static AstClafer |
getLowestCommonSupertype(Iterable<AstClafer> unionType)
Finds the lowest common supertype.
|
static String[] |
getNames(AstVar... vars)
Retrieve the names of the variables.
|
static List<String> |
getNames(Iterable<? extends AstVar> vars)
Retrieve the names of the Clafers.
|
static List<AstClafer> |
getNestedClafers(AstClafer clafer)
Find all the Clafers below the supplied one, including itself.
|
static List<AstConstraint> |
getNestedConstraints(AstModel model)
Find all the constraints in the model.
|
static List<AstClafer> |
getSuperHierarchy(AstClafer clafer)
Finds the supertype hierarchy of the Clafer.
|
static List<AstAbstractClafer> |
getSupers(AstClafer clafer)
Finds all the supertypes of the Clafer in order of lowest to highest.
|
static AstClafer |
getTopParent(AstClafer clafer)
Find the highest non-root Clafer above the supplied one.
|
static boolean |
hasInheritedRef(AstClafer clafer) |
static boolean |
hasNonEmptyIntersectionType(AstClafer t1,
AstClafer t2)
Detects if a set of
t1 can share elements with a set of
t2 . |
static boolean |
isAssignable(AstClafer from,
AstClafer to)
Detects if a set of
from is also a set of to . |
static boolean |
isRoot(AstConcreteClafer clafer)
Detects if the Clafer is the implicit root of the model.
|
static boolean |
isTop(AstClafer clafer)
Detects if the Clafer is directly under the root.
|
static boolean |
isTypeRoot(AstAbstractClafer clafer)
Detects if the Clafer is the implicit type root of the model.
|
static boolean |
isUnionType(AstClafer union,
AstClafer[] partitions)
Detects if the union type is fully covered by the partitions.
|
public static List<AstClafer> getClafers(AstModel model)
model
- the Clafer modelpublic static List<AstConcreteClafer> getConcreteClafers(AstModel model)
model
- the Clafer modelpublic static List<Set<AstClafer>> getClafersInParentAndSubOrder(AstModel model)
model
- the Clafer modelpublic static List<AstAbstractClafer> getAbstractClafersInSubOrder(AstModel model)
model
- the Clafer modelpublic static List<AstConcreteClafer> getConcreteClafersInParentOrder(AstModel model)
model
- the Clafer modelpublic static boolean isRoot(AstConcreteClafer clafer)
clafer
- the Clafertrue
if and only if the Clafer is the root, false
otherwisepublic static boolean isTypeRoot(AstAbstractClafer clafer)
clafer
- the Clafertrue
if and only if the Clafer is the type root,
false
otherwisepublic static boolean isTop(AstClafer clafer)
clafer
- the Clafertrue
if and only if the Clafer is a top Clafer,
false
otherwisepublic static AstClafer getTopParent(AstClafer clafer)
clafer
- the Claferpublic static List<AstClafer> getNestedClafers(AstClafer clafer)
clafer
- the Claferpublic static List<AstConcreteClafer> getConcreteSubs(AstClafer clafer)
clafer
- the Claferpublic static List<AstConstraint> getNestedConstraints(AstModel model)
model
- the modelpublic static List<AstAbstractClafer> getSupers(AstClafer clafer)
clafer
- the Claferpublic static List<AstClafer> getSuperHierarchy(AstClafer clafer) throws AnalysisException
clafer : getSupers clafer
.clafer
- the ClaferAnalysisException
- a cycle in the type hierarchypublic static boolean isAssignable(AstClafer from, AstClafer to)
from
is also a set of to
.from
- the subtypeto
- the supertypetrue
if and only if to is a supertype of from,
false
otherwisepublic static boolean hasNonEmptyIntersectionType(AstClafer t1, AstClafer t2)
t1
can share elements with a set of
t2
.t1
- first typet2
- second typetrue
if and only if the first and second type intersect,
false
otherwisepublic static boolean isUnionType(AstClafer union, AstClafer[] partitions)
isUnionType(Animal, Arrays.asList(Primate, Human, Dolphin))
would
return true
if and only if primates, humans, and dolphins are the
only animals. If humans are primates, the result would still hold.union
- the union typepartitions
- the partition of the union typetrue
if and only if the partitions fully cover the union
type, false
otherwisepublic static AstClafer getLowestCommonSupertype(Iterable<AstClafer> unionType)
unionType
- the union typeunionType
public static AstClafer getLowestCommonSupertype(AstClafer... unionType)
unionType
- the union typeunionType
public static boolean hasInheritedRef(AstClafer clafer)
public static AstRef getInheritedRef(AstClafer clafer)
clafer
- the Clafernull
if none existpublic static String[] getNames(AstVar... vars)
Object.toString()
.vars
- the variablesCopyright © 2013. All Rights Reserved.