public InternalLocaleBuilder setLanguageTag(LanguageTag langtag) {
        clear();
        if (!langtag.getExtlangs().isEmpty()) {
            language = langtag.getExtlangs().get(0);
        } else {
            String lang = langtag.getLanguage();
            if (!lang.equals(LanguageTag.UNDETERMINED)) {
                language = lang;
            }
        }
        script = langtag.getScript();
        region = langtag.getRegion();

        List<String> bcpVariants = langtag.getVariants();
        if (!bcpVariants.isEmpty()) {
            StringBuilder var = new StringBuilder(bcpVariants.get(0));
            int size = bcpVariants.size();
            for (int i = 1; i < size; i++) {
                var.append(BaseLocale.SEP).append(bcpVariants.get(i));
            }
            variant = var.toString();
        }

        setExtensions(langtag.getExtensions(), langtag.getPrivateuse());

        return this;
    }
public InternalLocaleBuilder setLanguageTag ( LanguageTag langtag ) { clear ( ) ; if ( ! langtag . getExtlangs ( ) . isEmpty ( ) ) { language = langtag . getExtlangs ( ) . get ( 0 ) ; } else { String lang = langtag . getLanguage ( ) ; if ( ! lang . equals ( LanguageTag . UNDETERMINED ) ) { language = lang ; } } script = langtag . getScript ( ) ; region = langtag . getRegion ( ) ; List < String > bcpVariants = langtag . getVariants ( ) ; if ( ! bcpVariants . isEmpty ( ) ) { StringBuilder var = new StringBuilder ( bcpVariants . get ( 0 ) ) ; int size = bcpVariants . size ( ) ; for ( int i = 1 ; i < size ; i ++ ) { var . append ( BaseLocale . SEP ) . append ( bcpVariants . get ( i ) ) ; } variant = var . toString ( ) ; } setExtensions ( langtag . getExtensions ( ) , langtag . getPrivateuse ( ) ) ; return this ; }
/*
Reset Builder's internal state with the given language tag