package Ġcom . ads am c ik . recycler . adapter . implementation . mult it ype Ċ Ċ /** Ċ Ġ* ĠMulti Ġtype Ġadapter Ġthat Ġbuilds Ġupon Ġ[ Base Multi Type Adapter ] Ġand Ġadds Ġsa fer Ġmethod Ġto Ġregister Ġtypes . Ċ Ġ* Ġwith Ġenums . Ċ Ġ*/ Ċ open Ġclass ĠMulti Type Adapter < DataType Enum Ġ: ĠEnum <* >, ĠData Ġ: ĠMulti Type Data < DataType Enum >, ĠViewHolder Ġ: ĠMulti Type ViewHolder < Data >> Ċ ĉ : ĠBase Multi Type Adapter < Data , ĠViewHolder >() Ġ{ ĊĊ ĉ /** Ċĉ Ġ* ĠRegisters Ġ[ Multi Type ViewHolder Creator ] Ġfor Ġgiven Ġ[ DataType Enum ]. Ċĉ Ġ* ĠProvides Ġadditional Ġtype Ġsafety Ġand Ġerror Ġreporting Ġcompared Ġto Ġ[ register Type ] Ċĉ Ġ* Ġwith Ġinteger Ġtype Ġvalue . Ċĉ Ġ* Ċĉ Ġ* Ġ@ param Ġtype Value ĠType Ġof Ġ[ Data ] Ġthe Ġ[ creator ] Ġcreates Ġview Ġholder Ġfor Ċĉ Ġ* Ġ@ param Ġcreator ĠView Ġholder Ġcreator Ġused Ġfor Ġcreating Ġviews Ġfor Ġdata Ġof Ġtype Ġ[ type Value ] Ċĉ Ġ* Ċĉ Ġ* Ġ@ throws ĠAlready Registered Exception ĠThrow n Ġwhen Ġtype Ġwas Ġpreviously Ġregistered Ċĉ Ġ*/ Ċ ĉ @ Throws ( Already Registered Exception :: class ) Ċ ĉ fun Ġregister Type ( Ċĉĉ ĉ type Value : ĠDataType Enum , Ċĉĉ ĉ creator : ĠMulti Type ViewHolder Creator < Data , ĠViewHolder > Ċ ĉ ) Ġ{ Ċĉ ĉ try Ġ{ Ċĉĉ ĉ register Type ( type Value . ordinal , Ġcreator ) Ċĉ ĉ } Ġcatch Ġ( e : ĠAlready Registered Exception ) Ġ{ Ċĉĉ ĉ throw ĠAlready Registered Exception (" Type Ġ$ type Value Ġalready Ġregistered ", Ġe ) Ċĉ ĉ } Ċ ĉ } Ċ } ĊĊ