private Func1 < ArrayList < SoundCloudComment > , ArrayList < SoundCloudComment > > cacheTrackComments ( ) { return new Func1 < ArrayList < SoundCloudComment > , ArrayList < SoundCloudComment > > ( ) { @ Override public ArrayList < SoundCloudComment > call ( ArrayList < SoundCloudComment > trackComments ) { if ( trackComments . size ( ) > 0 ) { mCacheRam . tracksComments . put ( trackComments . get ( 0 ) . getTrackId ( ) , trackComments ) ; } return trackComments ; } } ; }
Cache the comments linked to a track retrieved from network in RAM to avoid requesting SoundCloud API for next call .