Package org.opengis.referencing

Examples of org.opengis.referencing.IdentifiedObject


        /**
         * Returns the identifier for the specified object.
         */
        @Override
        public String findIdentifier(final IdentifiedObject object) throws FactoryException {
            IdentifiedObject candidate;
            candidate = (IdentifiedObject) findCache.get(object);
            if (candidate != null) {
                return getIdentifier(candidate);
            }
            return super.findIdentifier(object);
View Full Code Here


     * code only when first needed. This method returns {@code true} if this set changed as a
     * result of this call.
     */
    public boolean addAuthorityCode(final String code) {
        final boolean already = objects.containsKey(code);
        final IdentifiedObject old = (IdentifiedObject) objects.put(code, null);
        if (old != null) {
            // A fully created object was already there. Keep it.
            objects.put(code, old);
            return false;
        }
View Full Code Here

     * it if needed.
     *
     * @throws BackingStoreException if the object creation failed.
     */
    private IdentifiedObject get(final String code) throws BackingStoreException {
        IdentifiedObject object = (IdentifiedObject) objects.get(code);
        if (object==null && objects.containsKey(code)) {
            try {
                object = createObject(code);
                objects.put(code, object);
            } catch (FactoryException exception) {
View Full Code Here

    /**
     * Returns {@code true} if this collection contains the specified object.
     */
    public boolean contains(final Object object) {
        final String code = getAuthorityCode((IdentifiedObject) object);
        final IdentifiedObject current = get(code);
        return object.equals(current);
    }
View Full Code Here

     * Removes a single instance of the specified element from this collection,
     * if it is present.
     */
    public boolean remove(final Object object) {
        final String code = getAuthorityCode((IdentifiedObject) object);
        final IdentifiedObject current = get(code);
        if (object.equals(current)) {
            objects.remove(code);
            return true;
        }
        return false;
View Full Code Here

         * Returns the next element.
         *
         * @throws NoSuchElementException if there is no more operations in the set.
         */
        public Object next() throws NoSuchElementException {
            final IdentifiedObject next = element;
            if (next == null) {
                throw new NoSuchElementException();
            }
            toNext();
            return next;
View Full Code Here

    public IdentifiedObject find(final IdentifiedObject object) throws FactoryException {
        /*
         * First check if one of the identifiers can be used to spot directly an
         * identified object (and check it's actually equal to one in the factory).
         */
        IdentifiedObject candidate = createFromIdentifiers(object);
        if (candidate != null) {
            return candidate;
        }
        /*
         * We are unable to find the object from its identifiers. Try a quick name lookup.
View Full Code Here

     * Returns the identifier of the specified object, or {@code null} if none. The default
     * implementation invokes <code>{@linkplain #find find}(object)</code> and extracts the
     * code from the returned {@linkplain IdentifiedObject identified object}.
     */
    public String findIdentifier(final IdentifiedObject object) throws FactoryException {
        final IdentifiedObject candidate = find(object);
        return (candidate != null) ? getIdentifier(candidate) : null;
    }
View Full Code Here

            final Identifier id = (Identifier) it.next();
            if (!isAll && !Citations.identifierMatches(authority, id.getAuthority())) {
                // The identifier is not for this authority. Looks the other ones.
                continue;
            }
            IdentifiedObject candidate;
            try {
                candidate = getProxy().create(id.getCode());
            } catch (NoSuchAuthorityCodeException e) {
                // The identifier was not recognized. No problem, let's go on.
                continue;
View Full Code Here

     * @see #createFromCodes
     * @see #createFromIdentifiers
     * @throws FactoryException if an error occured while creating an object.
     */
    final IdentifiedObject createFromNames(final IdentifiedObject object) throws FactoryException {
        IdentifiedObject candidate;
        try {
            candidate = getProxy().create(object.getName().getCode());
            candidate = deriveEquivalent(candidate, object);
            if (candidate != null) {
                return candidate;
View Full Code Here

TOP

Related Classes of org.opengis.referencing.IdentifiedObject

Copyright © 2018 www.massapicom. 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.