1 /*
2 * This file is a part of CAST project.
3 * (c) Copyright 2007, AGH University of Science & Technology
4 * https://caribou.iisg.agh.edu.pl/trac/cast
5 *
6 * Licensed under the Eclipse Public License, Version 1.0 (the "License").
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 * http://www.eclipse.org/legal/epl-v10.html
10 */
11 /*
12 * File: IGeneralDataSet.java
13 * Created: 2009-03-25
14 * Author: kpietak
15 * $Id: IGeneralDataSet.java 3227 2009-08-20 10:01:23Z tmilos $
16 */
17
18 package pl.edu.agh.cast.data.model.general;
19
20 import java.util.Arrays;
21 import java.util.Collection;
22 import java.util.Collections;
23
24 import pl.edu.agh.cast.data.model.Type;
25 import pl.edu.agh.cast.data.model.domain.IDomainDataSet;
26
27 /**
28 * General data set which is set of entities ({@link IEntity}) connected with relations ({@link IManyToManyRelation}).
29 * It can contain alone entities (without any associated relations) but each relation has to be associated with at least
30 * two entities.
31 *
32 * @param <T>
33 * type of contained elements
34 *
35 * @author AGH CAST Team
36 */
37 public interface IGeneralDataSet<T extends IGeneralElement> extends IDomainDataSet<T> {
38
39 /**
40 * The type of {@link IGeneralDataSet}.
41 */
42 public static final Type TYPE = Type.fromClass(IGeneralDataSet.class);
43
44 /**
45 * Collection of element types accepted by this type of data set.
46 */
47 public static final Collection<Type> ACCEPTED_TYPES = Collections.unmodifiableCollection(Arrays.asList(
48 IGeneralElement.TYPE, IEntity.TYPE, IManyToManyRelation.TYPE, IOneToOneRelation.TYPE,
49 ITimedManyToManyRelation.TYPE, ITimedOneToOneRelation.TYPE));
50
51 /**
52 * Returns all entities contained in the data set.
53 *
54 * @return collection of all entities from the data set; if data set contains no entities then an empty collection
55 */
56 public Collection<IEntity> getEntities();
57
58 /**
59 * Returns all relations (many-to-many) contained in the data set.
60 *
61 * @return collection of all many-to-many relations from the data set; if data set contains no relations then an
62 * empty collection
63 */
64 public Collection<IManyToManyRelation> getRelations();
65
66 }