Examples of InternationalString


Examples of org.opengis.util.InternationalString

        boolean showHeaders  = false;
        boolean showNaNCount = false;
        for (int i=0; i<stats.length; i++) {
            final Statistics s = stats[i];
            showNaNCount |= (s.countNaN() != 0);
            final InternationalString header = s.name();
            if (header != null) {
                headers[i] = header.toString(headerLocale);
                showHeaders |= (headers[i] != null);
            }
        }
        char horizontalLine = 0;
        String separator = columnSeparator;
View Full Code Here

Examples of org.opengis.util.InternationalString

     * using ISO 8601 date format.
     */
    @Override
    public String getVersion() {
        if (authority != null) {
            final InternationalString version = authority.getEdition();
            if (version != null) {
                return version.toString();
            }
        }
        return null;
    }
View Full Code Here

Examples of org.opengis.util.InternationalString

    public static boolean titleMatches(final Citation c1, final Citation c2) {
        if (c1 != null && c2 != null) {
            if (c1 == c2) {
                return true; // Optimisation for a common case.
            }
            InternationalString candidate = c2.getTitle();
            Iterator<? extends InternationalString> iterator = null;
            do {
                if (candidate != null) {
                    final String unlocalized = candidate.toString(Locale.ROOT);
                    if (titleMatches(c1, unlocalized)) {
                        return true;
                    }
                    final String localized = candidate.toString();
                    if (!Objects.equals(localized, unlocalized) // Slight optimization for a common case.
                            && titleMatches(c1, localized))
                    {
                        return true;
                    }
View Full Code Here

Examples of org.opengis.util.InternationalString

     * @return {@code true} if both arguments are non-null, and the title or alternate
     *         title matches the given string.
     */
    public static boolean titleMatches(final Citation citation, final CharSequence title) {
        if (citation != null && title != null) {
            InternationalString candidate = citation.getTitle();
            Iterator<? extends InternationalString> iterator = null;
            do {
                if (candidate != null) {
                    final String unlocalized = candidate.toString(Locale.ROOT);
                    if (equalsFiltered(unlocalized, title, LETTERS_AND_DIGITS, true)) {
                        return true;
                    }
                    final String localized = candidate.toString();
                    if (!Objects.equals(localized, unlocalized) // Slight optimization for a common case.
                            && equalsFiltered(localized, title, LETTERS_AND_DIGITS, true))
                    {
                        return true;
                    }
View Full Code Here

Examples of org.opengis.util.InternationalString

    public static DefaultLocalName castOrCopy(final LocalName object) {
        if (object == null || object instanceof DefaultLocalName) {
            return (DefaultLocalName) object;
        }
        final NameSpace scope = object.scope();
        final InternationalString name = object.toInternationalString();
        final LocalName result;
        if (object instanceof MemberName) {
            result = DefaultFactories.SIS_NAMES.createMemberName(scope, name, ((MemberName) object).getAttributeType());
        } else if (object instanceof TypeName) {
            result = DefaultFactories.SIS_NAMES.createTypeName(scope, name);
View Full Code Here

Examples of org.opengis.util.InternationalString

     * Tests the formatting of an international string.
     */
    @Test
    @DependsOnMethod("testGetResources")
    public void testFormatInternational() {
        InternationalString i18n = Errors.formatInternational(Errors.Keys.NullArgument_1);
        assertEquals("Argument ‘{0}’ shall not be null.",      i18n.toString(Locale.ROOT));
        assertEquals("Argument ‘{0}’ shall not be null.",      i18n.toString(Locale.ENGLISH));
        assertEquals("L’argument ‘{0}’ ne doit pas être nul.", i18n.toString(Locale.FRENCH));
        assertNotSame(i18n, assertSerializedEquals(i18n));

        i18n = Errors.formatInternational(Errors.Keys.NullArgument_1, "CRS");
        assertEquals("Argument ‘CRS’ shall not be null.",      i18n.toString(Locale.ROOT));
        assertEquals("Argument ‘CRS’ shall not be null.",      i18n.toString(Locale.ENGLISH));
        assertEquals("L’argument ‘CRS’ ne doit pas être nul.", i18n.toString(Locale.FRENCH));
        assertNotSame(i18n, assertSerializedEquals(i18n));
    }
View Full Code Here

Examples of org.opengis.util.InternationalString

     * @return {@code true} if the given object contains all localized strings found in this
     *         international string.
     */
    public synchronized boolean isSubsetOf(final Object candidate) {
        if (candidate instanceof InternationalString) {
            final InternationalString string = (InternationalString) candidate;
            for (final Map.Entry<Locale,String> entry : localeMap.entrySet()) {
                final Locale locale = entry.getKey();
                final String text   = entry.getValue();
                if (!text.equals(string.toString(locale))) {
                    return false;
                }
            }
        } else if (candidate instanceof CharSequence) {
            final String string = candidate.toString();
View Full Code Here

Examples of org.opengis.util.InternationalString

     */
    private static CharSequence name(final GenericName name) {
        if (name instanceof DefaultLocalName) {
            return ((DefaultLocalName) name).name;
        }
        final InternationalString label = name.toInternationalString();
        return (label != null) ? label : name.toString();
    }
View Full Code Here

Examples of org.opengis.util.InternationalString

    /**
     * Tests the {@link Types#getDescription(Class)} method.
     */
    @Test
    public void testGetDescription() {
        final InternationalString description = Types.getDescription(CharacterSet.class);
        assertEquals("Name of the character coding standard used in the resource.",
                description.toString(Locale.ROOT));
        assertEquals("Name of the character coding standard used in the resource.",
                description.toString(Locale.ENGLISH));
        assertEquals("Jeu de caractères.",
                description.toString(Locale.FRENCH));
    }
View Full Code Here

Examples of org.opengis.util.InternationalString

    /**
     * Tests the {@link Types#getDescription(CodeList)} method.
     */
    @Test
    public void testGetCodeDescription() {
        final InternationalString description = Types.getDescription(CharacterSet.ISO_8859_1);
        assertEquals("ISO/IEC 8859-1, Information technology - 8-bit single byte coded graphic character sets - Part 1 : Latin alphabet No.1.",
                description.toString(Locale.ROOT));
        assertEquals("ISO/IEC 8859-1, Information technology - 8-bit single byte coded graphic character sets - Part 1 : Latin alphabet No.1.",
                description.toString(Locale.ENGLISH));
        assertEquals("ISO/IEC 8859-1, alphabet latin 1.",
                description.toString(Locale.FRENCH));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.