public long getMillisecondsFromId ( final Object id , final long offset ) { if ( id instanceof String && id . toString ( ) . length ( ) >= MAX_LONG_ALPHANUMERIC_VALUE_LENGTH ) { final char [ ] buffer = new char [ MAX_LONG_ALPHANUMERIC_VALUE_LENGTH ] ; System . arraycopy ( id . toString ( ) . toCharArray ( ) , 0 , buffer , 0 , MAX_LONG_ALPHANUMERIC_VALUE_LENGTH ) ; final boolean overflow = buffer [ 0 ] > ' ' ; if ( overflow ) { buffer [ 0 ] -= 2 ; } long value = Long . parseLong ( new String ( buffer ) , ALPHA_NUMERIC_CHARSET_SIZE ) ; if ( overflow ) { value -= Long . MAX_VALUE + 1 ; } return value + offset ; } throw new IllegalArgumentException ( "'" + id + "' is not an id from this generator" ) ; }
Retrieve the number of milliseconds since 1st Jan 1970 that were the base for the given id .