package Ġinfo . tr it us k . labor ator ium chem ia e . library . research Ċ Ċ import Ġinfo . tr it us k . labor ator ium chem ia e . api . reaction . Reaction Ċ import Ġinfo . tr it us k . labor ator ium chem ia e . api . reaction . Reaction Manager Ċ import Ġinfo . tr it us k . labor ator ium chem ia e . api . reaction . Reaction Type Ċ import Ġinfo . tr it us k . labor ator ium chem ia e . api . research . Research Ċ import Ġinfo . tr it us k . labor ator ium chem ia e . api . research . Research Manager Ċ import Ġinfo . tr it us k . labor ator ium chem ia e . api . research . data . Research Data Ċ import Ġjava . io . Object InputStream Ċ import Ġjava . io . Object OutputStream Ċ import Ġjava . io . Serializable Ċ import Ġjavax . annotation . concurrent . Not Thread Safe Ċ Ċ /** Ċ Ġ* ĠMutable Ġimplementation Ġof Ġ{@ link plain ĠResearch Data }. Ċ Ġ*/ Ċ @ Not Thread Safe Ċ data Ġclass ĠHot Sw appable Research Data ( ĊĠĠĠĠĠĠĠ Ġvar Ġwrapped Research Ġ: ĠResearch ?, ĊĠĠĠĠĠĠĠ Ġvar Ġwrapped Reaction Ġ: ĠRe action ? Ċ ) Ġ: ĠResearch Data , ĠSerializable Ġ{ ĊĠĠĠ Ġconstructor () Ġ: Ġthis ( null , Ġnull ) ĊĊĠĠĠ Ġoverride Ġfun Ġget Reaction () Ġ: ĠRe action Ġ= Ġwrapped Reaction Ġ?: ĠRe action Manager . EMPTY _ RE ACTION ĊĊĠĠĠ Ġoverride Ġfun Ġget Research () Ġ: ĠResearch Ġ= Ġwrapped Research Ġ?: ĠResearch Manager . EMPTY _ RE SEARCH ĊĊĠĠĠ Ġprivate Ġfun Ġwrite Object ( out : ĠObject OutputStream ) Ġ{ ĊĠĠĠĠĠĠĠ Ġout . write UTF ( wrapped Research ?. research Name Ġ?: Ġ"") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġread Object (` in `: ĠObject InputStream ) Ġ{ ĊĠĠĠĠĠĠĠ Ġwrapped Research Ġ= ĠResearch Manager . INSTANCE . find Research (` in `. read UTF ()). get () ĊĠĠĠĠĠĠĠ Ġ// val Ġreaction ID Ġ= Ġ` in `. read UTF () ĊĠĠĠĠĠĠĠ Ġwrapped Reaction Ġ= ĠRe action Manager . INSTANCE . getAll ( Reaction Type . Defaults . values ()[ ` in `. readInt ()] ). find Last Ġ{ Ġtrue Ġ} Ġ// TODO ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġread Object No Data () Ġ= ĠUnit Ġ// ĠNothing Ġhappened , Ġkeep Ġwrapped Ġresearch Ġand Ġreaction Ġas Ġnull Ċ Ċ }