@Test public void testSymTypeExpressionFactory(){ SymTypeVoid tVoid = SymTypeExpressionFactory.createTypeVoid(); assertEquals("void",tVoid.print()); SymTypeOfNull tNull = SymTypeExpressionFactory.createTypeOfNull(); assertEquals("nullType",tNull.print()); SymTypeConstant tInt = SymTypeExpressionFactory.createTypeConstant("int"); assertEquals("int",tInt.print()); assertTrue(tInt.isIntegralType()); SymTypeOfGenerics tA = SymTypeExpressionFactory.createGenerics("A",scope); assertEquals("A<>",tA.print()); assertTrue(tA.isEmptyArguments()); SymTypeOfGenerics tB = SymTypeExpressionFactory.createGenerics("B",scope,Lists.newArrayList(teArr1,teIntA)); assertEquals("B<Human[],java.lang.Integer>",tB.print()); assertEquals(2,tB.sizeArguments()); SymTypeOfGenerics tC = SymTypeExpressionFactory.createGenerics("C",scope,teDeep1,teDeep2); assertEquals("C<java.util.Set<Map<int,de.x.Person>>,java.util.Map2<int,java.util.Set<Map<int,de.x.Person>>>>",tC.print()); assertEquals(2,tC.sizeArguments()); SymTypeOfGenerics tD = SymTypeExpressionFactory.createGenerics("D",scope); assertEquals("D<>",tD.print()); assertTrue(tD.isEmptyArguments()); SymTypeOfGenerics tE = SymTypeExpressionFactory.createGenerics("E",scope,Lists.newArrayList(teDouble,teMap)); assertEquals("E<double,Map<int,de.x.Person>>",tE.print()); assertEquals(2,tE.sizeArguments()); SymTypeOfGenerics tF = SymTypeExpressionFactory.createGenerics("F",scope,teH,teP); assertEquals("F<Human,de.x.Person>",tF.print()); assertEquals(2,tF.sizeArguments()); SymTypeArray tHuman = SymTypeExpressionFactory.createTypeArray("Human",scope,1,teH); assertEquals("Human[]",tHuman.print()); assertEquals(1,tHuman.getDim()); assertEquals("Human",tHuman.getArgument().print()); SymTypeArray tPerson = SymTypeExpressionFactory.createTypeArray("de.x.Person",scope,2,teP); assertEquals("de.x.Person[][]",tPerson.print()); assertEquals(2,tPerson.getDim()); assertEquals("de.x.Person",tPerson.getArgument().print()); SymTypeOfObject tG = SymTypeExpressionFactory.createTypeObject("G",scope); assertEquals("G",tG.print()); SymTypeOfObject tH = SymTypeExpressionFactory.createTypeObject("H",scope); assertEquals("H",tH.print()); SymTypeVariable tT = SymTypeExpressionFactory.createTypeVariable("T",scope); assertEquals("T",tT.print()); SymTypeVariable tS = SymTypeExpressionFactory.createTypeVariable("S",scope); assertEquals("S",tS.print()); SymTypeExpression tExpr = SymTypeExpressionFactory.createTypeExpression("void",scope); assertTrue(tExpr instanceof SymTypeVoid); assertEquals("void",tExpr.print()); }
public abstract String print();
SymTypeExpression { public abstract String print(); }
SymTypeExpression { public abstract String print();  }
SymTypeExpression { public abstract String print();  abstract String print(); boolean isTypeConstant(); boolean isGenericType(); boolean isTypeVariable(); boolean isArrayType(); boolean isVoidType(); boolean isNullType(); boolean isObjectType(); abstract SymTypeExpression deepClone(); abstract boolean deepEquals(SymTypeExpression sym); List<FunctionSymbol> getMethodList(String methodname); List<FunctionSymbol> getMethodList(String methodName, boolean outerIsType); List<VariableSymbol> getFieldList(String fieldName); List<VariableSymbol> getFieldList(String fieldName, boolean outerIsType); TypeSymbol getTypeInfo(); List<TypeSymbol> getInnerTypeList(String name); }
SymTypeExpression { public abstract String print();  abstract String print(); boolean isTypeConstant(); boolean isGenericType(); boolean isTypeVariable(); boolean isArrayType(); boolean isVoidType(); boolean isNullType(); boolean isObjectType(); abstract SymTypeExpression deepClone(); abstract boolean deepEquals(SymTypeExpression sym); List<FunctionSymbol> getMethodList(String methodname); List<FunctionSymbol> getMethodList(String methodName, boolean outerIsType); List<VariableSymbol> getFieldList(String fieldName); List<VariableSymbol> getFieldList(String fieldName, boolean outerIsType); TypeSymbol getTypeInfo(); List<TypeSymbol> getInnerTypeList(String name);  }