
## Source Code: Lattice.Java

1 /∗
2 ∗ L a t t i c e . j av a : p a r t o f pa ckag e R e f e r e eTo o lb ox ; I n t e r f a c e f **o r l a t t i c e .** 3 **∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗**
4 ∗ Copyr ight ( c ) 2010 FrÃc dÃc **ric D am b r e v i l l e**
5 ∗
6 ∗ Author : FrÃc dÃc **ric D am b r e v i l l e <h t tp : / / em a i l . f r e d e r i c d a m b r e v i l l e . com>**
7 ∗
8 ∗ **Th is f i l e i s p a r t o f R e f e r e eTo o lb ox .** 9 ∗
10 ∗ **R e f e r e eTo o lb ox i s f r e e s o f t w a r e : you can r e d i s t r i b u t e i t and/ o r mod i fy**
11 ∗ **i t und e r th e t e rms o f th e GNU G e n e r a l P u b l i c L i c e n s e a s p u b l i sh e d by** 12 ∗ **th e Fr e e S o f twa r e Foundat ion , e i t h e r v e r s i o n 3 o f th e L i c e n se , o r** 13 ∗ **( a t your o p t i o n ) any l a t e r v e r s i o n .**
14 ∗
15 ∗ R e f e r e eTo o lb ox i s d i s t r i b u t e d i n th e hope th a t i t w i l l be u s e **f u l ,** 16 ∗ but WITHOUT ANY WARRANTY; w i th ou t ev en th e im p l i e d warranty o f 17 ∗ **MERCHANTABILITY o r FITNESS FOR A PARTICULAR PURPOSE. S e e the**
18 ∗ **GNU G e n e r a l P u b l i c L i c e n s e f o r more d e t a i l s .**
19 ∗ 20 ∗ **You sh ou ld have r e c e i v e d a copy o f th e GNU G e n e r a l P u b l i c L i c en s e**
21 ∗ **a l on g w ith R e f e r e eTo o lb ox . I f not , s e e <h t tp : / /www . gnu . o rg / l i c e n s e s />.**
22 **∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗** 23 ∗/
24 25 **pa ckag e** RefereeToolbox ;
26 27 /∗∗
28 ∗ Con t a in s th e m in ima l methods f o r a c l a s s imp l em ent ing a L a t t **i c e s t r u c t u r e .**
29 ∗
30 ∗ @author <A h r e f =" h t tp : / / em a i l . f r e d e r i c d a m b r e v i l l e . com">FrÃc dÃc ric ←֓
D am b r e v i l l e</A>
31 ∗
32 ∗
33 ∗
34 ∗ **<BR><BR><t a b l e b o rd e r = '1 ' c e l l P a d d i n g ='4'>< t r><td>** 35 ∗ <f o n t c o l o r ="\#008000" s t y l e =" f on t−**f am i l y : g e o r g i a ">**
36 ∗ Copyr ight ( c ) 2010 FrÃc dÃc **ric D am b r e v i l l e<BR>**
37 ∗ **<BR>**
38 ∗ **R e f e r e eTo o lb ox i s f r e e s o f t w a r e : you can r e d i s t r i b u t e i t and/ o r mod i fy**
39 ∗ **i t und e r th e t e rms o f th e GNU G e n e r a l P u b l i c L i c e n s e a s p u b l i sh e d by** 40 ∗ **th e Fr e e S o f twa r e Foundat ion , e i t h e r v e r s i o n 3 o f th e L i c e n se , o r**
41 ∗ **( a t your o p t i o n ) any l a t e r v e r s i o n .<BR>**
42 ∗ **<BR>**
43 ∗ R e f e r e eTo o lb ox i s d i s t r i b u t e d i n th e hope th a t i t w i l l be u s e **f u l ,** 44 ∗ but WITHOUT ANY WARRANTY; w i th ou t ev en th e im p l i e d warranty o f 45 ∗ **MERCHANTABILITY o r FITNESS FOR A PARTICULAR PURPOSE. S e e the**
46 ∗ **GNU G e n e r a l P u b l i c L i c e n s e f o r more d e t a i l s .<BR>** 47 ∗ **<BR>** 48 ∗ **You sh ou ld have r e c e i v e d a copy o f th e GNU G e n e r a l P u b l i c L i c en s e**
49 ∗ **a l on g w ith R e f e r e eTo o lb ox . I f not , s e e**
50 ∗ **<a h r e f = ' h t tp : / /www . gnu . o r g / l i c e n s e s / '> h t tp : / /www . gnu . o r g / l i c e n s e s /</a>.** 51 ∗ **</f on t ></t a b l e><BR>**
52 ∗
53 ∗/
54 **p u b l i c i n t e r f a c e** Lattice<L> **e x t e nd s** Comparable <L>, Cloneable {
55 56 /∗∗
57 ∗ Return a r e p r e s e n t a t i o n o f th e s t a t e o f <i>t h i s </ i> p r i n t e d a s 58 ∗ **a S t r i n g .**
59 ∗ 60 ∗/
61 String state **( ) ;**
62 63 /∗∗
64 ∗ **S e t o r r e t u r n th e s i z e o f <i>t h i s </ i >.** 65 ∗ **D i f f e n r e n t c a s e s a r e c o n s i d e r e d :**
66 ∗ **<br><br>** 67 ∗ <i>n ewS i z e<0</ i> −− **The s i z e o f <i>t h i s </ i> i s k ept unchanged , and t h i s s i z e**
68 ∗ **i s r e t u r n e d by th e method .** 69 ∗ **<br>**
70 ∗ <i>n ewS i z e>=0</i> −− **I f <i>n ewS i z e</ i> i s a v a l i d new s i z e , th en th e s i z e o f**
71 ∗ <i>t h i s </ i> i s changed t o <i>n ewS i z e</ i >, and t h i s s i z e i s r **e t u r n e d by th e** ←֓