/ *   
 
   *   P R O J E C T :   N y A R T o o l k i t C S ( E x t e n s i o n ) 
 
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
   *   T h e   N y A R T o o l k i t C S   i s   J a v a   e d i t i o n   A R T o o l K i t   c l a s s   l i b r a r y . 
 
   *   C o p y r i g h t   ( C ) 2 0 0 8 - 2 0 0 9   R y o   I i z u k a 
 
   * 
 
   *   T h i s   p r o g r a m   i s   f r e e   s o f t w a r e :   y o u   c a n   r e d i s t r i b u t e   i t   a n d / o r   m o d i f y 
 
   *   i t   u n d e r   t h e   t e r m s   o f   t h e   G N U   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 s h e d   b y 
 
   *   t h e   F r e e   S o f t w a r e   F o u n d a t i o n ,   e i t h e r   v e r s i o n   3   o f   t h e   L i c e n s e ,   o r 
 
   *   ( a t   y o u r   o p t i o n )   a n y   l a t e r   v e r s i o n . 
 
   *   
 
   *   T h i s   p r o g r a m   i s   d i s t r i b u t e d   i n   t h e   h o p e   t h a t   i t   w i l l   b e   u s e f u l , 
 
   *   b u t   W I T H O U T   A N Y   W A R R A N T Y ;   w i t h o u t   e v e n   t h e   i m p l i e d   w a r r a n t y   o f 
 
   *   M E R C H A N T A B I L I T Y   o r   F I T N E S S   F O R   A   P A R T I C U L A R   P U R P O S E .     S e e   t h e 
 
   *   G N U   G e n e r a l   P u b l i c   L i c e n s e   f o r   m o r e   d e t a i l s . 
 
   * 
 
   *   Y o u   s h o u l d   h a v e   r e c e i v e d   a   c o p y   o f   t h e   G N U   G e n e r a l   P u b l i c   L i c e n s e 
 
   *   a l o n g   w i t h   t h i s   p r o g r a m .     I f   n o t ,   s e e   < h t t p : / / w w w . g n u . o r g / l i c e n s e s / > . 
 
   *   
 
   *   F o r   f u r t h e r   i n f o r m a t i o n   p l e a s e   c o n t a c t . 
 
   * 	 h t t p : / / n y a t l a . j p / n y a t o o l k i t / 
 
   * 	 < a i r m a i l ( a t ) e b o n y . p l a l a . o r . j p >   o r   < n y a t l a ( a t ) n y a t l a . j p > 
 
   *   
 
   * / 
 
 
 
 u s i n g   S y s t e m . D i a g n o s t i c s ; 
 
 n a m e s p a c e   j p . n y a t l a . n y a r t o o l k i t . c s . c o r e 
 
 { 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
         / * * 
 
           *   S0n0000o000000j0000000000n0W,g000g0Y00
 
           *   ubnn00000000pe@b	gW0f00Nn0000000k0N0_j0cOW0~0Y00
 
           *   Sgq00000cd0{tU00_0000000000L0_j0Bfk0o00{ @ l i n k   N y A R M a n a g e d O b j e c t P o o l } 0000O(uW0~0Y00
 
           *   @ p a r a m   < T > 
 
           *    }n0000000W
 
           * / 
 
         p u b l i c   c l a s s   N y A R O b j e c t P o o l < T > 
 
         { 
 
                 / * *  0 }n0O{000* / 
 
                 p r o t e c t e d   T [ ]   _ b u f f e r ; 
 
                 / * *  0*grRS_n0 }0000* / 
 
                 p r o t e c t e d   T [ ]   _ p o o l ; 
 
                 / * *   *grRS_n0 }n0pe* / 
 
                 p r o t e c t e d   i n t   _ p o o l _ s t o c k ; 
 
 
 
                 / * * 
 
                   *   S0n0peo00eW0D00000000PrR0S_f0f0ԏW0~0Y00
 
                   *   @ r e t u r n 
 
                   *   eW0D000000001YWeW0_04XTo0n u l l 
 
                   * / 
 
                 p u b l i c   T   n e w O b j e c t ( ) 
 
                 { 
 
                         i f   ( t h i s . _ p o o l _ s t o c k   <   1 ) 
 
                         { 
 
                                 r e t u r n   d e f a u l t ( T ) ; 
 
                         } 
 
                         t h i s . _ p o o l _ s t o c k - - ; 
 
                         r e t u r n   t h i s . _ p o o l [ t h i s . _ p o o l _ s t o c k ] ; 
 
 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo00000000000x00000000ԏtSW0~0Y00
 
                   *   @ p a r a m  0i _ o b j e c t 
 
                   *   { @ l i n k   # n e w O b j e c t } g0rR0S_f0_00000000c[W0~0Y00
 
                   *   _Z0TX0000000g0rR0S_f0_00000000c[W0f0O0`0U0D00
 
                   * / 
 
                 p u b l i c   v o i d   d e l e t e O b j e c t ( T   i _ o b j e c t ) 
 
                 { 
 
                         D e b u g . A s s e r t ( i _ o b j e c t   ! =   n u l l ) ; 
 
                         D e b u g . A s s e r t ( t h i s . _ p o o l _ s t o c k   <   t h i s . _ p o o l . L e n g t h ) ; 
 
                         / / ꁫn0cOW0_0000000K00xY00n0o0weu0
 
                         t h i s . _ p o o l [ t h i s . _ p o o l _ s t o c k ]   =   i _ o b j e c t ; 
 
                         t h i s . _ p o o l _ s t o c k + + ; 
 
                 } 
 
 
 
                 / * * 
 
                   *   0000000g0Y00
 
                   *   ubb&Tn0pk0000000000=W0~0Y00
 
                   *   }b0000\ObW0f0O0`0U0D00
 
                   * / 
 
                 p u b l i c   N y A R O b j e c t P o o l ( ) 
 
                 { 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo000000000RgSW0~0Y00
 
                   *   }b000n00000000K00|Ts0QW0~0Y00
 
                   *   @ p a r a m   i _ l e n g t h 
 
                   *   MRn0 g'YwU0
 
                   *   @ p a r a m   i _ e l e m e n t _ t y p e 
 
                   *   MRW0:yY0000000
 
                   *   @ 
 
                   * / 
 
                 p r o t e c t e d   v o i d   i n i t I n s t a n c e ( i n t   i _ l e n g t h ) 
 
                 { 
 
                         / / WxO
 
                         t h i s . _ b u f f e r   =   n e w   T [ i _ l e n g t h ] ; 
 
                         t h i s . _ p o o l   =   n e w   T [ i _ l e n g t h ] ; 
 
                         / / O(u-NPpe00000
 
                         t h i s . _ p o o l _ s t o c k   =   i _ l e n g t h ; 
 
                         / / 0000000\Ob
 
                         f o r   ( i n t   i   =   t h i s . _ p o o l . L e n g t h   -   1 ;   i   > =   0 ;   i - - ) 
 
                         { 
 
                                 t h i s . _ b u f f e r [ i ]   =   t h i s . _ p o o l [ i ]   =   c r e a t e E l e m e n t ( ) ; 
 
                         } 
 
                         r e t u r n ; 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo00MR }n00000000P\O0~0Y00
 
                   *   { @ l i n k   # i n i t I n s t a n c e ( i n t ,   C l a s s ) } K00|Ts0QU00~0Y00
 
                   *   }b000g0000000W0f00 }0000000PubW0f0ԏY0Qt0[ňW0f0O0`0U0D00
 
                   *   @ r e t u r n 
 
                   *   eW0D00000000ԏW0f0O0`0U0D00
 
                   *   @ 
 
                   * / 
 
                 p r o t e c t e d   v i r t u a l   T   c r e a t e E l e m e n t ( ) 
 
                 { 
 
                         t h r o w   n e w   N y A R E x c e p t i o n ( ) ; 
 
                 } 
 
 
 
         } 
 
 } 