DefaultLocalName changes for revisions 20815:20874

Changes in the GeoTools header, and necessary additions for changes in GeoAPI interfaces. The method signatures are imported from GeoAPI interfaces - this is not a GeoTools contribution. The method implementations are different in SIS/Geotk, except name() which is implemented as mandated by GeoAPI (so this is not a GeoTools creation neither).

Command line:

svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r20815:20874 https://svn.osgeo.org/geotools/trunk/modules/library/metadata/src/main/java/org/geotools/util/LocalName.java
Revision 20815Revision 20874
/*
 * Geotools 2 - OpenSource mapping toolkit
 * (C) 2004, Geotools Project Managment Committee (PMC)
 * (C) 2004, Institut de Recherche pour le Développement
 *
 *    This library is free software; you can redistribute it and/or
/*
 *    GeoTools - OpenSource mapping toolkit
 *    http://geotools.org
 *    (C) 2004-2006, Geotools Project Managment Committee (PMC)
 * (C) 2004, Institut de Recherche pour le Développement
 *
 *    This library is free software; you can redistribute it and/or
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
*    Lesser General Public License for more details.
*
*    You should have received a copy of the GNU Lesser General Public
*    License along with this library; if not, write to the Free Software
*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*
*    This package contains documentation from OpenGIS specifications.
*    OpenGIS consortium's work is fully acknowledged here.
*/
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
*    Lesser General Public License for more details.
*
*    This package contains documentation from OpenGIS specifications.
*    OpenGIS consortium's work is fully acknowledged here.
*/
// OpenGIS dependencies
import org.opengis.util.GenericName;
import org.opengis.util.InternationalString;
import org.opengis.util.ScopedName;

// Geotools dependencies
import org.geotools.resources.Utilities;


/**
 * Identifier within a name space for a local object. This could be the target object of the
 * {@link GenericName}, or a pointer to another name space (with a new {@link GenericName})
// OpenGIS dependencies
import org.opengis.util.GenericName;
import org.opengis.util.InternationalString;
import org.opengis.util.NameSpace;
import org.opengis.util.ScopedName;

// Geotools dependencies
import org.geotools.resources.Utilities;

//import sun.reflect.generics.reflectiveObjects.NotImplementedException;


/**
 * Identifier within a name space for a local object. This could be the target object of the
 * {@link GenericName}, or a pointer to another name space (with a new {@link GenericName})
 * This method is protected from overriding by the user.
 */
private GenericName getInternalScope() {
    return (asScopedName!=null) ? asScopedName.getScope() : null;
}

/**
 * Returns the scope (name space) of this generic name. This method returns the same
 * value than the one returned by the {@linkplain ScopedName scoped}
 * version of this name. In other words, the following relation shall be respected:
 * <blockquote><table border='0'><tr>
 *   <td nowrap>{@link ScopedName#asLocalName}</td>
 *   <td nowrap>{@code .getScope() ==}</td>
 *   <td nowrap align="right">{@link ScopedName}</td>
 *   <td nowrap>{@code .getScope()}</td>
 * </tr><tr>
 *   <td align="center"><font size=2>(a locale name)</font></td>
 *   <td>&nbsp;</td>
 *   <td align="center"><font size=2>(a scoped name)</font></td>
 *   <td>&nbsp;</td>
 * </tr></table></blockquote>
 */
public GenericName getScope() {
    return getInternalScope();
 * This method is protected from overriding by the user.
 */
private GenericName getInternalScope() {
    return (asScopedName == null || asScopedName.scope() == null) ?
                    null :
                            asScopedName.scope().name();
}

/**
 * Returns the scope (name space) of this generic name.
 *
 * @deprecated scope()
 * @return scope()
 */
public GenericName getScope() {
    return getInternalScope();
        if (name != null) code ^= name.hashCode();
        return code;
    }
}
        if (name != null) code ^= name.hashCode();
        return code;
    }

        public int depth() {
                return getInternalScope().depth()+1;
}

        public org.opengis.util.LocalName name() {
                return this;
        }

        public NameSpace scope() {
                return (asScopedName!=null) ? asScopedName.scope() : null;
        }

        public GenericName toFullyQualifiedName() {
                throw new UnsupportedOperationException();
                //throw new NotImplementedException();
        }

        public ScopedName push(GenericName scope) {
                throw new UnsupportedOperationException();
                //throw new NotImplementedException();
        }
}