Class TypeConformanceComputer.MaxDistanceRawTypeAcceptor

  extended by org.eclipse.xtext.common.types.util.TypeConformanceComputer.MaxDistanceRawTypeAcceptor
All Implemented Interfaces:
Enclosing class:

protected static class TypeConformanceComputer.MaxDistanceRawTypeAcceptor
extends java.lang.Object
implements SuperTypeCollector.SuperTypeAcceptor

Populates a Multiset with the maximum number of necessary steps from a given type to its super types. Sorting the set by the steps creates a stable order on from the direct super class, the most specialized implemented interfaces up to object. E.g. although StringBuilder implements Serializable and CharSequence, serializable is treated as more special by this algorithm since the super class AbstractStringBuilder implements CharSequence, too. Thus the number of steps to Serializable is 1 while CharSequence requires 2 hops.

Constructor Summary
protected TypeConformanceComputer.MaxDistanceRawTypeAcceptor(<JvmType> result,<JvmType,JvmTypeReference> all,<JvmTypeReference,JvmTypeReference> resolver)
Method Summary
 boolean accept(JvmTypeReference superType, int distance)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


protected TypeConformanceComputer.MaxDistanceRawTypeAcceptor(<JvmType> result,
                                                   <JvmType,JvmTypeReference> all,
                                                   <JvmTypeReference,JvmTypeReference> resolver)
Method Detail


public boolean accept(JvmTypeReference superType,
                      int distance)
Specified by:
accept in interface SuperTypeCollector.SuperTypeAcceptor
superType - a found super type