1 /*
2 Licensed to the Apache Software Foundation (ASF) under one
3 or more contributor license agreements. See the NOTICE file
4 distributed with this work for additional information
5 regarding copyright ownership. The ASF licenses this file
6 to you under the Apache License, Version 2.0 (the
7 "License"); you may not use this file except in compliance
8 with the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied. See the License for the
16 specific language governing permissions and limitations
17 under the License.
18 =================== DO NOT EDIT THIS FILE ====================
19 Generated by Modello 2.5.1,
20 any modifications will be overwritten.
21 ==============================================================
22 */
23
24 package org.apache.maven.plugins.pmd.model;
25
26 /**
27 * Class Duplication.
28 *
29 * @version $Revision$ $Date$
30 */
31 @SuppressWarnings( "all" )
32 public class Duplication
33 implements java.io.Serializable
34 {
35
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
39
40 /**
41 * Field lines.
42 */
43 private int lines = 0;
44
45 /**
46 * Field tokens.
47 */
48 private int tokens = 0;
49
50 /**
51 * Field files.
52 */
53 private java.util.List<CpdFile> files;
54
55 /**
56 * Field codefragment.
57 */
58 private String codefragment;
59
60
61 //-----------/
62 //- Methods -/
63 //-----------/
64
65 /**
66 * Method addFile.
67 *
68 * @param cpdFile a cpdFile object.
69 */
70 public void addFile( CpdFile cpdFile )
71 {
72 getFiles().add( cpdFile );
73 } //-- void addFile( CpdFile )
74
75 /**
76 * Get the codefragment field.
77 *
78 * @return String
79 */
80 public String getCodefragment()
81 {
82 return this.codefragment;
83 } //-- String getCodefragment()
84
85 /**
86 * Method getFiles.
87 *
88 * @return List
89 */
90 public java.util.List<CpdFile> getFiles()
91 {
92 if ( this.files == null )
93 {
94 this.files = new java.util.ArrayList<CpdFile>();
95 }
96
97 return this.files;
98 } //-- java.util.List<CpdFile> getFiles()
99
100 /**
101 * Get the lines field.
102 *
103 * @return int
104 */
105 public int getLines()
106 {
107 return this.lines;
108 } //-- int getLines()
109
110 /**
111 * Get the tokens field.
112 *
113 * @return int
114 */
115 public int getTokens()
116 {
117 return this.tokens;
118 } //-- int getTokens()
119
120 /**
121 * Method removeFile.
122 *
123 * @param cpdFile a cpdFile object.
124 */
125 public void removeFile( CpdFile cpdFile )
126 {
127 getFiles().remove( cpdFile );
128 } //-- void removeFile( CpdFile )
129
130 /**
131 * Set the codefragment field.
132 *
133 * @param codefragment a codefragment object.
134 */
135 public void setCodefragment( String codefragment )
136 {
137 this.codefragment = codefragment;
138 } //-- void setCodefragment( String )
139
140 /**
141 * Set the files field.
142 *
143 * @param files a files object.
144 */
145 public void setFiles( java.util.List<CpdFile> files )
146 {
147 this.files = files;
148 } //-- void setFiles( java.util.List )
149
150 /**
151 * Set the lines field.
152 *
153 * @param lines a lines object.
154 */
155 public void setLines( int lines )
156 {
157 this.lines = lines;
158 } //-- void setLines( int )
159
160 /**
161 * Set the tokens field.
162 *
163 * @param tokens a tokens object.
164 */
165 public void setTokens( int tokens )
166 {
167 this.tokens = tokens;
168 } //-- void setTokens( int )
169
170 }