Project

General

Profile

« Previous | Next » 

Revision 1406

Added by Jing Tao about 21 years ago

Implement clone method.

View differences:

AccessSection.java
80 80
      return this.accessRules;
81 81
    }
82 82
    
83
    /** Method to copy a accesssection object to a new one */
83 84
    public Object clone()
84 85
    {
85
      return this.clone();
86
      //create a new AccessSection object
87
      AccessSection newAccessSection = new AccessSection();
88
      // set parameters
89
      MetaCatUtil.debugMessage("Copy Access Section Id: " +
90
                                this.getAccessSectionId(), 35);
91
      newAccessSection.setAccessSectionId(this.getAccessSectionId());
92
      MetaCatUtil.debugMessage("Copy permission order: " +
93
                                this.getPermissionOrder(), 35);
94
      newAccessSection.setPermissionOrder(this.getPermissionOrder());
95
      Vector accessRuleVector = this.getAccessRules();
96
      // go through access rule vector
97
      for (int i=0; i< accessRuleVector.size(); i++)
98
      {
99
        AccessRule access = (AccessRule)accessRuleVector.elementAt(i);
100
        newAccessSection.addAccessRule(access);
101
      }
102
      
103
      return newAccessSection;
86 104
    }
87 105
 
88 106
}

Also available in: Unified diff