1 23 24 package org.objectweb.medor.type.lib; 25 26 import org.objectweb.jorm.type.api.PType; 27 import org.objectweb.jorm.type.api.PTypeSpace; 28 29 32 public class QTypeTuple extends QType { 33 public final static short TYPECODE_TUPLE = 101; 34 35 protected PType[] attributeTypes = null; 36 37 42 public QTypeTuple(PType[] types, PTypeSpace typespace) { 43 super("tuple", typespace); 44 attributeTypes = types; 45 } 46 47 54 public boolean isa(PType pt) { 55 if (!(pt instanceof QTypeTuple) || 57 (attributeTypes.length != ((QTypeTuple) pt).attributeTypes.length)) 58 return false; 59 int i = 0; 61 while (i < attributeTypes.length) { 62 if (!attributeTypes[i].isa(((QTypeTuple) pt).attributeTypes[i])) 63 return false; 64 } 65 return true; 67 } 68 69 } 70 | Popular Tags |