/ *   
 
   *   P R O J E C T :   N y A R T o o l k i t ( E x t e n s i o n ) 
 
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
   *   T h e   N y A R T o o l k i t   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 > 
 
   *   
 
   * / 
 
 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 . n y i d m a r k e r 
 
 { 
 
 
 
         / * * 
 
           *   S0n0000o00R a w b i t 0000n0I d 0000L o n g n00000$Pk0Y0000000g0Y00
 
           *   R a w b i t 000n0000000[ 0 ] [ 1 ] . . . [ n ] n0k0&Ny0f006 4 b i t n0I d $P0\O0~0Y00
 
           *   00000000000 00000 0M o d e l 5 *gnn00000[ak0W0~0Y00
 
           * / 
 
         p u b l i c   c l a s s   N y I d M a r k e r D a t a E n c o d e r _ R a w B i t I d   :   N y I d M a r k e r D a t a E n c o d e r _ R a w B i t 
 
         { 
 
                 p r i v a t e   N y I d M a r k e r D a t a _ R a w B i t   _ t m p   =   n e w   N y I d M a r k e r D a t a _ R a w B i t ( ) ; 
 
                 p u b l i c   o v e r r i d e   b o o l   e n c o d e ( N y I d M a r k e r P a t t e r n   i _ d a t a ,   I N y I d M a r k e r D a t a   o _ d e s t ) 
 
                 { 
 
                         / / [aK0y000
 
                         i f   ( i _ d a t a . c t r l _ d o m a i n   ! =   0 ) 
 
                         { 
 
                                 r e t u r n   f a l s e ; 
 
                         } 
 
                         / / SQ0eQ0000M a s k o00 n00
 
                         i f   ( i _ d a t a . c t r l _ m a s k   ! =   0 ) 
 
                         { 
 
                                 r e t u r n   f a l s e ; 
 
                         } 
 
                         / / SQ0eQ0000M o d e l o05 *gn
 
                         i f   ( i _ d a t a . m o d e l   > =   5 ) 
 
                         { 
 
                                 r e t u r n   f a l s e ; 
 
                         } 
 
                         / / 00000W0f000
 
                         i f   ( ! b a s e . e n c o d e ( i _ d a t a ,   t h i s . _ t m p ) ) 
 
                         { 
 
                                 r e t u r n   f a l s e ; 
 
                         } 
 
                         / / S e r i a l I D n0Qib
 
                         u l o n g   s   =   0 ; 
 
                         / /  g'Y4 000K~R0f0Pn0i n t $Pk0	Yc
 
                         f o r   ( i n t   i   =   0 ;   i   <   t h i s . _ t m p . l e n g t h ;   i + + ) 
 
                         { 
 
                                 s   =   ( s   < <   8 )   |   ( u i n t ) t h i s . _ t m p . p a c k e t [ i ] ; 
 
                         } 
 
                         ( ( N y I d M a r k e r D a t a _ R a w B i t I d ) o _ d e s t ) . m a r k e r _ i d   =   ( l o n g ) s ; 
 
                         r e t u r n   t r u e ; 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo00{ @ l i n k   N y I d M a r k e r D a t a _ R a w B i t I d } Wn00000000ubW0f0ԏW0~0Y00
 
                   * / 
 
                 p u b l i c   o v e r r i d e   I N y I d M a r k e r D a t a   c r e a t e D a t a I n s t a n c e ( ) 
 
                 { 
 
                         r e t u r n   n e w   N y I d M a r k e r D a t a _ R a w B i t I d ( ) ; 
 
                 } 
 
         } 
 
 } 
 
 