nl_tokens: Creates a new time range type with the specified name if it does not already exist .
pl_tokens: public static Type createInstance ( String name , TimeOnly <mask> , TimeOnly max ) { // Ensure that min is less than or equal to max. if ( ( min != null ) && ( max != null ) && ( min . compareTo ( max ) > 0 ) ) { throw new IllegalArgumentException ( "'min' must be less than or equal to 'max'." ) ; } synchronized ( INT_RANGE_TYPES ) { // Add the newly created type to the map of all types. TimeRangeType newType = new TimeRangeType ( name , min , max ) ; // Ensure that the named type does not already exist, unless it has an identical definition already, in which // case the old definition can be re-used and the new one discarded. TimeRangeType oldType = INT_RANGE_TYPES . get ( name ) ; if ( ( oldType != null ) && ! oldType . equals ( newType ) ) { throw new IllegalArgumentException ( "The type '" + name + "' already exists and cannot be redefined." ) ; } else if ( ( oldType != null ) && oldType . equals ( newType ) ) { return oldType ; } else { INT_RANGE_TYPES . put ( name , newType ) ; return newType ; } } }