001// =================== DO NOT EDIT THIS FILE ==================== 002// Generated by Modello 1.8.1, 003// any modifications will be overwritten. 004// ============================================================== 005 006package org.apache.maven.doxia.document; 007 008/** 009 * A Table Of Content for the document. 010 * 011 * @version $Revision$ $Date$ 012 */ 013@SuppressWarnings( "all" ) 014public class DocumentTOC 015 implements java.io.Serializable 016{ 017 018 //--------------------------/ 019 //- Class/Member Variables -/ 020 //--------------------------/ 021 022 /** 023 * 024 * The name to use for the Table of Contents. 025 * 026 */ 027 private String name; 028 029 /** 030 * 031 * The level up to which toc items are included by 032 * default. 033 * Defaults to 0 which means only top-level element 034 * entries are included. 035 * A depth of 1 includes one level of sub-items 036 * (sub-sections), etc. 037 * This may be overridden for individual entries by 038 * using the collapse 039 * attribute of the corresponding toc item. 040 * 041 */ 042 private int depth = 0; 043 044 /** 045 * Field items. 046 */ 047 private java.util.List<DocumentTOCItem> items; 048 049 050 //-----------/ 051 //- Methods -/ 052 //-----------/ 053 054 /** 055 * Method addItem. 056 * 057 * @param documentTOCItem 058 */ 059 public void addItem( DocumentTOCItem documentTOCItem ) 060 { 061 getItems().add( documentTOCItem ); 062 } //-- void addItem( DocumentTOCItem ) 063 064 /** 065 * Method equals. 066 * 067 * @param other 068 * @return boolean 069 */ 070 public boolean equals( Object other ) 071 { 072 if ( this == other ) 073 { 074 return true; 075 } 076 077 if ( !( other instanceof DocumentTOC ) ) 078 { 079 return false; 080 } 081 082 DocumentTOC that = (DocumentTOC) other; 083 boolean result = true; 084 085 result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) ); 086 result = result && depth == that.depth; 087 result = result && ( getItems() == null ? that.getItems() == null : getItems().equals( that.getItems() ) ); 088 089 return result; 090 } //-- boolean equals( Object ) 091 092 /** 093 * Get the level up to which toc items are included by default. 094 * Defaults to 0 which means only top-level element 095 * entries are included. 096 * A depth of 1 includes one level of sub-items 097 * (sub-sections), etc. 098 * This may be overridden for individual entries by 099 * 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}