void put ( PatternWrapper pattern , Conjunction selector , MatchTarget object , InternTable subExpr ) throws MatchingException { if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "put" , new Object [ ] { pattern , selector , object , subExpr } ) ; switch ( pattern . getState ( ) ) { case PatternWrapper . FINAL_EXACT : exactChild = owner . nextMatcher ( selector , exactChild ) ; exactChild . put ( selector , object , subExpr ) ; break ; case PatternWrapper . FINAL_MANY : if ( hasMidClauses ( pattern ) ) { // We have multiple multi-level wildcarding and need to work with the // matchManyChildren list ContentMatcher next = null ; MatchManyWrapper wrapper = findMatchManyWrapper ( pattern ) ; if ( wrapper != null ) next = wrapper . matcher ; ContentMatcher newNext = owner . nextMatcher ( selector , next ) ; if ( newNext != next ) { if ( matchManyChildren == null ) matchManyChildren = new ArrayList ( 3 ) ; // 3 is somewhat arbitrary MatchManyWrapper matchManyElement = new MatchManyWrapper ( pattern , newNext ) ; matchManyChildren . add ( matchManyElement ) ; } newNext . put ( selector , object , subExpr ) ; } else { // Simpler case where there is a single multi-level wildcard singleMatchManyChild = owner . nextMatcher ( selector , singleMatchManyChild ) ; singleMatchManyChild . put ( selector , object , subExpr ) ; } break ; case PatternWrapper . PREFIX_CHARS : case PatternWrapper . SUFFIX_CHARS : PartialMatch pm = findOrCreate ( pattern . getChars ( ) ) ; pm . put ( pattern , selector , object , subExpr ) ; break ; case PatternWrapper . SKIP_ONE_PREFIX : case PatternWrapper . SKIP_ONE_SUFFIX : if ( matchOneChild == null ) matchOneChild = newPartialMatch ( ) ; pattern . advance ( ) ; matchOneChild . put ( pattern , selector , object , subExpr ) ; break ; case PatternWrapper . SWITCH_TO_SUFFIX : if ( suffix == null ) suffix = newPartialMatch ( ) ; pattern . advance ( ) ; suffix . put ( pattern , selector , object , subExpr ) ; break ; } if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "put" ) ; }
Put a new Pattern or part thereof into this PartialMatch or its down - chain peers