@ Override public void addTimestamp ( final U u , final I i , final Long t ) { Map < I , Set < Long > > userTimestamps = userItemTimestamps . get ( u ) ; if ( userTimestamps == null ) { userTimestamps = new HashMap <> ( ) ; userItemTimestamps . put ( u , userTimestamps ) ; } Set < Long > timestamps = userTimestamps . get ( i ) ; if ( timestamps == null ) { timestamps = new HashSet <> ( ) ; userTimestamps . put ( i , timestamps ) ; } timestamps . add ( t ) ; }
Method that adds a timestamp to the model between a user and an item .