@Test public void obtaining_existing_data_type() throws Exception { BagDataType t = BagDataType.bag_of(m_type, m_scope); assertSame(m_bag_type, t); }
public static BagDataType bag_of(DataType inner, PrimitiveScope pscope) { Ensure.not_null(inner); Ensure.not_null(pscope); Ensure.is_true(inner.in_scope(pscope)); DataTypeScope scope = inner.parent_dts(); DataType found = null; try { found = scope.find(build_bag_name(inner)); } catch (AmbiguousNameException e) { } if (found == null) { found = new BagDataType(inner, pscope.any()); scope.add(found); } Ensure.not_null(found); Ensure.is_instance(found, BagDataType.class); return (BagDataType) found; }
BagDataType extends CollectionDataType { public static BagDataType bag_of(DataType inner, PrimitiveScope pscope) { Ensure.not_null(inner); Ensure.not_null(pscope); Ensure.is_true(inner.in_scope(pscope)); DataTypeScope scope = inner.parent_dts(); DataType found = null; try { found = scope.find(build_bag_name(inner)); } catch (AmbiguousNameException e) { } if (found == null) { found = new BagDataType(inner, pscope.any()); scope.add(found); } Ensure.not_null(found); Ensure.is_instance(found, BagDataType.class); return (BagDataType) found; } }
BagDataType extends CollectionDataType { public static BagDataType bag_of(DataType inner, PrimitiveScope pscope) { Ensure.not_null(inner); Ensure.not_null(pscope); Ensure.is_true(inner.in_scope(pscope)); DataTypeScope scope = inner.parent_dts(); DataType found = null; try { found = scope.find(build_bag_name(inner)); } catch (AmbiguousNameException e) { } if (found == null) { found = new BagDataType(inner, pscope.any()); scope.add(found); } Ensure.not_null(found); Ensure.is_instance(found, BagDataType.class); return (BagDataType) found; } BagDataType(DataType inner_type, AnyType any); }
BagDataType extends CollectionDataType { public static BagDataType bag_of(DataType inner, PrimitiveScope pscope) { Ensure.not_null(inner); Ensure.not_null(pscope); Ensure.is_true(inner.in_scope(pscope)); DataTypeScope scope = inner.parent_dts(); DataType found = null; try { found = scope.find(build_bag_name(inner)); } catch (AmbiguousNameException e) { } if (found == null) { found = new BagDataType(inner, pscope.any()); scope.add(found); } Ensure.not_null(found); Ensure.is_instance(found, BagDataType.class); return (BagDataType) found; } BagDataType(DataType inner_type, AnyType any); static final String build_bag_name(DataType inner); static BagDataType bag_of(DataType inner, PrimitiveScope pscope); @Override BagDataValue make(); @Override boolean is_abstract(); }
BagDataType extends CollectionDataType { public static BagDataType bag_of(DataType inner, PrimitiveScope pscope) { Ensure.not_null(inner); Ensure.not_null(pscope); Ensure.is_true(inner.in_scope(pscope)); DataTypeScope scope = inner.parent_dts(); DataType found = null; try { found = scope.find(build_bag_name(inner)); } catch (AmbiguousNameException e) { } if (found == null) { found = new BagDataType(inner, pscope.any()); scope.add(found); } Ensure.not_null(found); Ensure.is_instance(found, BagDataType.class); return (BagDataType) found; } BagDataType(DataType inner_type, AnyType any); static final String build_bag_name(DataType inner); static BagDataType bag_of(DataType inner, PrimitiveScope pscope); @Override BagDataValue make(); @Override boolean is_abstract();  }