001 package nl.cwi.sen1.visbase.factbrowser.data;
002
003 import java.util.ArrayList;
004
005 /**
006 * This class represent the RStore. Every RStore has a collection of facts which
007 * will be contained in this class. It will offer methods to get the details of
008 * the RStore and get the children Facts.
009 *
010 * @author Renze de Vries
011 * @date 14-02-2007
012 *
013 */
014 public class RStore {
015 private ArrayList<RStoreFact> factNodes;
016
017 private String rstoreName;
018
019 private int rstoreID;
020
021 /**
022 * This is the default constructor which will be used as a failsafe. The
023 * normal constructor to use is the following: RStoreNode(String rstoreName,
024 * int rstoreID)
025 *
026 * @author Renze de Vries
027 * @date 14-02-2007
028 */
029 public RStore() {
030 factNodes = new ArrayList<RStoreFact>();
031 }
032
033 /**
034 * Constructor wich will set the name of the RStore and the RstoreID and
035 * will initialise the children factNodes container
036 *
037 * @param rstoreName
038 * THis is the visual name of the RStore
039 * @param rstoreID
040 * This is the identifier of the RStore
041 *
042 * @author Renze de Vries
043 * @date 13-02-2007
044 */
045 public RStore(String rstoreName, int rstoreID) {
046 this.rstoreName = rstoreName;
047 this.rstoreID = rstoreID;
048 factNodes = new ArrayList<RStoreFact>();
049 }
050
051 /**
052 * This method will make it possible to add an Child factNode
053 *
054 * @param factNode
055 * This is to add a FactNode to the RStore
056 *
057 * @author Renze de Vries
058 * @date 13-02-2007
059 */
060 public void addFactNode(RStoreFact factNode) {
061 factNodes.add(factNode);
062 }
063
064 /**
065 * This method will return the ArrayList which contains all the children
066 * FactNodes
067 *
068 * @return the ArrayList for the factNodes
069 *
070 * @author Renze de Vries
071 * @date 14-02-2007
072 */
073 public ArrayList<RStoreFact> getFactNodes() {
074 return this.factNodes;
075 }
076
077 /**
078 * Method will make it possible to display the name of the RStore in the
079 * tree
080 *
081 * @author Renze de Vries
082 * @date 14-02-2007
083 */
084 public String toString() {
085 return rstoreName;
086 }
087
088 /**
089 * This is the method which will the return the unique Identifier of the
090 * RStore.
091 *
092 * @return THe unique identifier
093 *
094 * @author Renze de Vries
095 * @date 14-02-2007
096 */
097 public int getRstoreId() {
098 return this.rstoreID;
099 }
100 }