db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/test/org/apache/ojb/broker AbstractProductGroup.java ProductGroup.java
Date Tue, 08 Apr 2003 16:24:06 GMT
brj         2003/04/08 09:24:05

  Modified:    src/test/org/apache/ojb/broker ProductGroup.java
  Added:       src/test/org/apache/ojb/broker AbstractProductGroup.java
  Log:
  Abstract ProductGroup
  
  Revision  Changes    Path
  1.3       +3 -136    db-ojb/src/test/org/apache/ojb/broker/ProductGroup.java
  
  Index: ProductGroup.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/ProductGroup.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ProductGroup.java	8 Nov 2002 13:55:47 -0000	1.2
  +++ ProductGroup.java	8 Apr 2003 16:24:02 -0000	1.3
  @@ -1,153 +1,20 @@
   package org.apache.ojb.broker;
   
  -import java.util.List;
  -import java.util.Vector;
   
   /** represents a product group containing a set of Articles.
    * @see Article
    */
  -public class ProductGroup implements InterfaceProductGroup
  +public class ProductGroup extends AbstractProductGroup
   {
  -    /** add article to group*/
  -    public synchronized void add(InterfaceArticle article)
  -    {
  -        if (allArticlesInGroup == null)
  -        {
  -            allArticlesInGroup = new Vector();
  -        }
  -        allArticlesInGroup.add(article);
  -    }
  -
  -    /** return group id*/
  -    public int getId()
  -    {
  -        return groupId;
  -    }
  -
  -    /**return string representation*/
  -    public String toString()
  -    {
  -        return
  -                "----\n" +
  -                "group Id:    " + groupId + "\n" +
  -                "name:        " + groupName + "\n" +
  -                "description: " + description + "\n" +
  -                "articles in group: " + allArticlesInGroup;
  -    }
  -
  -    /** return groupname*/
  -    public String getName()
  -    {
  -        return groupName;
  -    }
  -
  -    /** collection containing all articles of a given product group*/
  -    private List allArticlesInGroup;
  -    /** a textual description of the group*/
  -    private String description;
  -    /** the unique id of a product group*/
  -    private int groupId;
   
       public ProductGroup()
       {
  +        super();
       }
   
       public ProductGroup(int pGroupId, String pGroupName, String pDescription)
       {
  -        groupId = pGroupId;
  -        groupName = pGroupName;
  -        description = pDescription;
  -    }
  -
  -    public void setName(String groupName)
  -    {
  -        this.groupName = groupName;
  -    }
  -
  -    /** the name of a group*/
  -    private String groupName;
  -
  -    /** return List of all Articles in productgroup*/
  -    public List getAllArticles()
  -    {
  -        return allArticlesInGroup;
  -    }
  -
  -    /** set group id*/
  -    public void setId(int newValue)
  -    {
  -        groupId = newValue;
  -    }
  -    /**
  -     * Gets the groupId.
  -     * @return Returns a int
  -     */
  -    public int getGroupId()
  -    {
  -        return groupId;
  -    }
  -
  -    /**
  -     * Sets the groupId.
  -     * @param groupId The groupId to set
  -     */
  -    public void setGroupId(int groupId)
  -    {
  -        this.groupId = groupId;
  -    }
  -
  -    /**
  -     * Gets the description.
  -     * @return Returns a String
  -     */
  -    public String getDescription()
  -    {
  -        return description;
  -    }
  -
  -    /**
  -     * Sets the description.
  -     * @param description The description to set
  -     */
  -    public void setDescription(String description)
  -    {
  -        this.description = description;
  -    }
  -
  -    /**
  -     * Gets the groupName.
  -     * @return Returns a String
  -     */
  -    public String getGroupName()
  -    {
  -        return groupName;
  -    }
  -
  -    /**
  -     * Sets the groupName.
  -     * @param groupName The groupName to set
  -     */
  -    public void setGroupName(String groupName)
  -    {
  -        this.groupName = groupName;
  -    }
  -
  -    /**
  -     * Gets the allArticlesInGroup.
  -     * @return Returns a List
  -     */
  -    public List getAllArticlesInGroup()
  -    {
  -        return allArticlesInGroup;
  -    }
  -
  -    /**
  -     * Sets the allArticlesInGroup.
  -     * @param allArticlesInGroup The allArticlesInGroup to set
  -     */
  -    public void setAllArticlesInGroup(List allArticlesInGroup)
  -    {
  -        this.allArticlesInGroup = allArticlesInGroup;
  +        super (pGroupId, pGroupName, pDescription);
       }
   
   }
  
  
  
  1.1                  db-ojb/src/test/org/apache/ojb/broker/AbstractProductGroup.java
  
  Index: AbstractProductGroup.java
  ===================================================================
  package org.apache.ojb.broker;
  
  import java.util.List;
  import java.util.Vector;
  
  /** represents a product group containing a set of Articles.
   * @see Article
   */
  public abstract class AbstractProductGroup implements InterfaceProductGroup
  {
      /** add article to group*/
      public synchronized void add(InterfaceArticle article)
      {
          if (allArticlesInGroup == null)
          {
              allArticlesInGroup = new Vector();
          }
          allArticlesInGroup.add(article);
      }
  
      /** return group id*/
      public int getId()
      {
          return groupId;
      }
  
      /**return string representation*/
      public String toString()
      {
          return
                  "----\n" +
                  "group Id:    " + groupId + "\n" +
                  "name:        " + groupName + "\n" +
                  "description: " + description + "\n" +
                  "articles in group: " + allArticlesInGroup;
      }
  
      /** return groupname*/
      public String getName()
      {
          return groupName;
      }
  
      /** collection containing all articles of a given product group*/
      private List allArticlesInGroup;
      /** a textual description of the group*/
      private String description;
      /** the unique id of a product group*/
      private int groupId;
  
      public AbstractProductGroup()
      {
      }
  
      public AbstractProductGroup(int pGroupId, String pGroupName, String pDescription)
      {
          groupId = pGroupId;
          groupName = pGroupName;
          description = pDescription;
      }
  
      public void setName(String groupName)
      {
          this.groupName = groupName;
      }
  
      /** the name of a group*/
      private String groupName;
  
      /** return List of all Articles in productgroup*/
      public List getAllArticles()
      {
          return allArticlesInGroup;
      }
  
      /** set group id*/
      public void setId(int newValue)
      {
          groupId = newValue;
      }
      /**
       * Gets the groupId.
       * @return Returns a int
       */
      public int getGroupId()
      {
          return groupId;
      }
  
      /**
       * Sets the groupId.
       * @param groupId The groupId to set
       */
      public void setGroupId(int groupId)
      {
          this.groupId = groupId;
      }
  
      /**
       * Gets the description.
       * @return Returns a String
       */
      public String getDescription()
      {
          return description;
      }
  
      /**
       * Sets the description.
       * @param description The description to set
       */
      public void setDescription(String description)
      {
          this.description = description;
      }
  
      /**
       * Gets the groupName.
       * @return Returns a String
       */
      public String getGroupName()
      {
          return groupName;
      }
  
      /**
       * Sets the groupName.
       * @param groupName The groupName to set
       */
      public void setGroupName(String groupName)
      {
          this.groupName = groupName;
      }
  
      /**
       * Gets the allArticlesInGroup.
       * @return Returns a List
       */
      public List getAllArticlesInGroup()
      {
          return allArticlesInGroup;
      }
  
      /**
       * Sets the allArticlesInGroup.
       * @param allArticlesInGroup The allArticlesInGroup to set
       */
      public void setAllArticlesInGroup(List allArticlesInGroup)
      {
          this.allArticlesInGroup = allArticlesInGroup;
      }
  
  }
  
  
  

Mime
View raw message