public void add ( StorageDirView dir , long blockId , long blockSizeBytes ) { Pair < List < Long > , Long > candidate ; if ( mDirCandidates . containsKey ( dir ) ) { candidate = mDirCandidates . get ( dir ) ; } else { candidate = new Pair < List < Long > , Long > ( new ArrayList < Long > ( ) , 0L ) ; mDirCandidates . put ( dir , candidate ) ; } candidate . getFirst ( ) . add ( blockId ) ; long blockBytes = candidate . getSecond ( ) + blockSizeBytes ; candidate . setSecond ( blockBytes ) ; long sum = blockBytes + dir . getAvailableBytes ( ) ; if ( mMaxBytes < sum ) { mMaxBytes = sum ; mDirWithMaxBytes = dir ; } }
Adds the block in the directory to this collection .