public long size ( Transaction transaction ) throws ObjectManagerException { // No trace because this is used by toString(), and hence by trace itself; long sizeFound ; // For return; synchronized ( this ) { sizeFound = availableSize ; // Move through the map adding in any extra available entries. if ( transaction != null ) { Entry entry = firstEntry ( transaction ) ; while ( entry != null ) { if ( entry . state == Entry . stateToBeAdded && entry . lockedBy ( transaction ) ) sizeFound ++ ; entry = successor ( entry , transaction ) ; } // while (entry != null). } // if (transaction != null). } // synchronized (this). return sizeFound ; }
Returns the number of key - value mappings in this map which ara available to the transaction .