public boolean has ( String key ) { String [ ] path = Key . split ( key ) ; int index = binarySearch ( path [ 0 ] ) ; try { return ( index >= 0 ) && ( ( path . length == 1 ) || ( ( BagObject ) container [ index ] . value ) . has ( path [ 1 ] ) ) ; } catch ( ClassCastException classCastException ) { // if a requested value is not a BagObject - this should be an exceptional case return false ; } }
Return whether or not the requested key or path is present in the BagObject or hierarchical bag - of - bags