method .

72 ∗ **<br><br>**
73 ∗ N .B . 1 . By d e f a u l t , t h i s method i s not imp lemented by { @ l ink L **a t t i c e } d i r e c t l y** ←֓
,
74 ∗ **but by i t s s u b c l a s s e s .**
75 ∗ **<br>** 76 ∗ N .B . 2 . The s i z e i s not n e c e s s a r i l l y th e c a r d i n a l o f th e l a t t i **c e , but may be**
77 ∗ **i n s t e a d th e number o f atom i c p r o p o s i t i o n s o f th e l a t t i c e .**
78 ∗ 79 ∗/
80 **i n t** size ( **i n t** newSize ) ;
81 82 /∗∗ 83 ∗ **R e s i z e <i>t h i s </ i> a t th e same s i z e than <i>input </ i >.**
84 ∗
85 ∗/
86 L size ( L input ) ;
87 88 /∗∗
89 ∗ **Do an e x a c t copy o f inpu t i n t o <i>t h i s </ i >.** 90 ∗
91 ∗/
92 L duplicate ( L input ) ;
93 94 /∗∗
95 ∗ C r e a t e and r e t u r n an i n s t a n c e o f <i>t h i s </ i> ( i . e . work l i k e **a <b>new</b> on**
96 ∗ th e C l a s s o f <i>t h i s </ i >) . N . B . {@ l ink L a t t i c e\#i n s t a n c e ( ) **} cannot be d e f i n e d** 97 ∗ **f o r g e n e r i c c l a s s e s but <u> i s n e c e s s a r y </u> f o r some methods . <u>I t has t o be**
98 ∗ d e f i n e d w ith th e non g e n e r i c ( t y p i c a l l y f i n a l ) sub−**c l a s s e s </u>.**
99 ∗ **<br><br>**
100 ∗ For a g i v e n non g e n e r i c sub−**c l a s s <i>myNonGener icSubc lass </ i >, a t y p i c a l** 101 ∗ **d e f i n i t i o n o f { @ l ink L a t t i c e\#i n s t a n c e ( ) } i s a s f o l l o w s :**
102 ∗ **<br><br>**
103 ∗ **<f o n t c o l o r ="\#004488">< code>** 104 ∗ **{@code @Overr ide }**
105 ∗ **<br>**
106 ∗ **p u b l i c myNonGen e r i cSubc lass i n s t a n c e ( ) { r e t u r n new myNonGen e r i cSubc lass ( ) ; }**
107 ∗ **</code></f on t>** 108 ∗
109 ∗/
110 L instance **( ) ;**
111 112 /∗∗
113 ∗ C r e a t e and r e t u r n an i n s t a n c e o f <i>t h i s </ i> and r e s i z e i t a t **th e same s i z e** ←֓
than <i>t h i s </ i >.

114 ∗ Th is method i s a c t u a l l y d e f i n e d and make a c a l l o f { @ l ink L a t t **i c e\#i n s t a n c e ( ) } .**
115 ∗ I t d o e s not need t o be d e f i n e d w ith th e non g e n e r i c sub−**c l a s s e s .**
116 ∗ 117 ∗ **@see L a t t i c e\#i n s t a n c e ( )**
118 ∗ 119 ∗/
120 L instanceNsize **( ) ;**
121 122 /∗∗
123 ∗ **C r e a t e a c l o n e o f <i>t h i s </ i >.** 124 ∗
125 ∗/
126 L clone **( ) ;**
127 128 /∗∗
129 ∗ **S e t <i>t h i s </ i> t o z e r o , th e n e u t r a l e l em e n t f o r**
130 ∗ { @ l ink L a t t i c e\#o r ( j av a . l an g . Ob j e c t , j av a . l an g . Ob j e c t ) } . 131 ∗ **N .B . I t i s n e c e s s a r y t o c a l l {@ l ink L a t t i c e\#s i z e } o r**
132 ∗ { @ l ink L a t t i c e\#s i z e ( j av a . l an g . Ob j e c t ) } b e f o r e any f i r s t **u s e o f t h i s** 133 ∗ **method .**
134 ∗ 135 ∗/
136 L zero **( ) ;**
137 138 /∗∗
139 ∗ **S e t <i>t h i s </ i> t o one , th e n e u t r a l e l em e n t f o r** 140 ∗ { @ l ink L a t t i c e\#and ( j av a . l an g . Ob j e c t , j av a . l an g . Ob j e c t **) } .**
141 ∗ **N .B . I t i s n e c e s s a r y t o c a l l {@ l ink L a t t i c e\#s i z e } o r** 142 ∗ { @ l ink L a t t i c e\#s i z e ( j av a . l an g . Ob j e c t ) } b e f o r e any f i r s t **u s e o f t h i s method .**