View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 1.9.1,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.doxia.document;
7   
8   /**
9    * A Table Of Content for the document.
10   * 
11   * @version $Revision$ $Date$
12   */
13  @SuppressWarnings( "all" )
14  public class DocumentTOC
15      implements java.io.Serializable
16  {
17  
18        //--------------------------/
19       //- Class/Member Variables -/
20      //--------------------------/
21  
22      /**
23       * 
24       *             The name to use for the Table of Contents.
25       *           
26       */
27      private String name;
28  
29      /**
30       * 
31       *             The level up to which toc items are included by
32       * default.
33       *             Defaults to 0 which means only top-level element
34       * entries are included.
35       *             A depth of 1 includes one level of sub-items
36       * (sub-sections), etc.
37       *             This may be overridden for individual entries by
38       * using the collapse
39       *             attribute of the corresponding toc item.
40       *           
41       */
42      private int depth = 0;
43  
44      /**
45       * Field items.
46       */
47      private java.util.List<DocumentTOCItem> items;
48  
49  
50        //-----------/
51       //- Methods -/
52      //-----------/
53  
54      /**
55       * Method addItem.
56       * 
57       * @param documentTOCItem
58       */
59      public void addItem( DocumentTOCItem documentTOCItem )
60      {
61          getItems().add( documentTOCItem );
62      } //-- void addItem( DocumentTOCItem )
63  
64      /**
65       * Method equals.
66       * 
67       * @param other
68       * @return boolean
69       */
70      public boolean equals( Object other )
71      {
72          if ( this == other )
73          {
74              return true;
75          }
76  
77          if ( !( other instanceof DocumentTOC ) )
78          {
79              return false;
80          }
81  
82          DocumentTOC that = (DocumentTOC) other;
83          boolean result = true;
84  
85          result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
86          result = result && depth == that.depth;
87          result = result && ( getItems() == null ? that.getItems() == null : getItems().equals( that.getItems() ) );
88  
89          return result;
90      } //-- boolean equals( Object )
91  
92      /**
93       * Get the level up to which toc items are included by default.
94       *             Defaults to 0 which means only top-level element
95       * entries are included.
96       *             A depth of 1 includes one level of sub-items
97       * (sub-sections), etc.
98       *             This may be overridden for individual entries by
99       * using the collapse
100      *             attribute of the corresponding toc item.
101      * 
102      * @return int
103      */
104     public int getDepth()
105     {
106         return this.depth;
107     } //-- int getDepth()
108 
109     /**
110      * Method getItems.
111      * 
112      * @return List
113      */
114     public java.util.List<DocumentTOCItem> getItems()
115     {
116         if ( this.items == null )
117         {
118             this.items = new java.util.ArrayList<DocumentTOCItem>();
119         }
120 
121         return this.items;
122     } //-- java.util.List<DocumentTOCItem> getItems()
123 
124     /**
125      * Get the name to use for the Table of Contents.
126      * 
127      * @return String
128      */
129     public String getName()
130     {
131         return this.name;
132     } //-- String getName()
133 
134     /**
135      * Method hashCode.
136      * 
137      * @return int
138      */
139     public int hashCode()
140     {
141         int result = 17;
142 
143         result = 37 * result + ( name != null ? name.hashCode() : 0 );
144         result = 37 * result + (int) depth;
145         result = 37 * result + ( items != null ? items.hashCode() : 0 );
146 
147         return result;
148     } //-- int hashCode()
149 
150     /**
151      * Method removeItem.
152      * 
153      * @param documentTOCItem
154      */
155     public void removeItem( DocumentTOCItem documentTOCItem )
156     {
157         getItems().remove( documentTOCItem );
158     } //-- void removeItem( DocumentTOCItem )
159 
160     /**
161      * Set the level up to which toc items are included by default.
162      *             Defaults to 0 which means only top-level element
163      * entries are included.
164      *             A depth of 1 includes one level of sub-items
165      * (sub-sections), etc.
166      *             This may be overridden for individual entries by
167      * using the collapse
168      *             attribute of the corresponding toc item.
169      * 
170      * @param depth
171      */
172     public void setDepth( int depth )
173     {
174         this.depth = depth;
175     } //-- void setDepth( int )
176 
177     /**
178      * Set tOC item.
179      * 
180      * @param items
181      */
182     public void setItems( java.util.List<DocumentTOCItem> items )
183     {
184         this.items = items;
185     } //-- void setItems( java.util.List )
186 
187     /**
188      * Set the name to use for the Table of Contents.
189      * 
190      * @param name
191      */
192     public void setName( String name )
193     {
194         this.name = name;
195     } //-- void setName( String )
196 
197     /**
198      * Method toString.
199      * 
200      * @return String
201      */
202     public java.lang.String toString()
203     {
204         StringBuilder buf = new StringBuilder( 128 );
205 
206         buf.append( "name = '" );
207         buf.append( getName() );
208         buf.append( "'" );
209         buf.append( "\n" ); 
210         buf.append( "depth = '" );
211         buf.append( getDepth() );
212         buf.append( "'" );
213         buf.append( "\n" ); 
214         buf.append( "items = '" );
215         buf.append( getItems() );
216         buf.append( "'" );
217 
218         return buf.toString();
219     } //-- java.lang.String toString()
220 
221 }