KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > JSci > maths > categories > Category


1 package JSci.maths.categories;
2
3 /**
4 * This interface defines a category.
5 * @jsci.planetmath Category
6 * @version 1.0
7 * @author Mark Hale
8 */

9 public interface Category {
10         /**
11         * Returns the identity morphism for an object.
12         */

13         Morphism identity(Object JavaDoc a);
14         /**
15         * Returns the cardinality of an object.
16         * In general, this may not be an Integer.
17         */

18         Object JavaDoc cardinality(Object JavaDoc a);
19         /**
20         * Returns a hom-set.
21         */

22         HomSet hom(Object JavaDoc a, Object JavaDoc b);
23
24         /**
25         * This interface defines a morphism in a category.
26         */

27         interface Morphism {
28                 /**
29                 * Returns the domain.
30                 */

31                 Object JavaDoc domain();
32                 /**
33                 * Returns the codomain.
34                 */

35                 Object JavaDoc codomain();
36                 /**
37                 * Maps an object from the domain to the codomain.
38                 */

39                 Object JavaDoc map(Object JavaDoc o);
40                 /**
41                 * Returns the composition of this morphism with another.
42                 */

43                 Morphism compose(Morphism m) throws UndefinedCompositionException;
44         }
45
46         /**
47         * This interface defines a hom-set.
48         */

49         interface HomSet {}
50 }
51
52
Popular Tags