public SmiOidNode findByOidPrefix ( int ... oid ) { SmiOidNode parent = getRootNode ( ) ; for ( int subId : oid ) { SmiOidNode result = parent . findChild ( subId ) ; if ( result == null ) { return parent ; } parent = result ; } return null ; }
This method can be used to find the best match for an OID . By comparing the length of the OID of the result and the input OID you can determine how many and which subIds where not matched .