KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jac > aspects > gui > CollectionPosition


1 /*
2   Copyright (C) 2002 Julien van Malderen
3   
4   This program is free software; you can redistribute it and/or modify
5   it under the terms of the GNU Lesser General Public License as
6   published by the Free Software Foundation; either version 2 of the
7   License, or (at your option) any later version.
8
9   This program is distributed in the hope that it will be useful,
10   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12   GNU Lesser General Public License for more details.
13
14   You should have received a copy of the GNU Lesser General Public License
15   along with this program; if not, write to the Free Software
16   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */

17
18 package org.objectweb.jac.aspects.gui;
19
20 import org.objectweb.jac.core.rtti.CollectionItem;
21
22 /**
23  * A class that represents a position in a given collection. */

24
25 public class CollectionPosition
26 {
27    CollectionItem collection;
28    CollectionView collectionView;
29    int index;
30    Object JavaDoc substance;
31
32    /**
33     * Constructs a new position.
34     *
35     * @param collectionView the collection view that corresponds to
36     * the substance
37     * @param collection the substance collection
38     * @param index the row index of this position
39     * @param substance the object that holds the collection */

40    public CollectionPosition(CollectionView collectionView,
41                              CollectionItem collection, int index,
42                              Object JavaDoc substance) {
43       this.collectionView = collectionView;
44       this.collection = collection;
45       this.index = index;
46       this.substance = substance;
47    }
48
49    /**
50     * Returns the collection view. */

51    public CollectionView getCollectionView() {
52       return collectionView;
53    }
54    
55    /**
56     * Returns the collection. */

57    public CollectionItem getCollection() {
58       return collection;
59    }
60    
61    /**
62     * The index of this position in the collection. */

63    public int getIndex() {
64       return index;
65    }
66    
67    /**
68     * Returns the substance that holds the collection. */

69    public Object JavaDoc getSubstance() {
70       return substance;
71    }
72 }
73
Popular Tags