Package org.openrdf.sail.rdbms.cursor

Source Code of org.openrdf.sail.rdbms.cursor.NamespaceCursor

/*
* Copyright Aduna (http://www.aduna-software.com/) (c) 2008.
*
* Licensed under the Aduna BSD-style license.
*/
package org.openrdf.sail.rdbms.cursor;

import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

import org.openrdf.cursor.CollectionCursor;
import org.openrdf.cursor.ConvertingCursor;
import org.openrdf.cursor.Cursor;
import org.openrdf.model.Namespace;
import org.openrdf.model.impl.NamespaceImpl;
import org.openrdf.store.StoreException;

/**
* {@link Namespace} typed {@link Cursor}.
*
* @author James Leigh
*/
public class NamespaceCursor extends ConvertingCursor<Map.Entry<String, String>, Namespace> {

  public NamespaceCursor(Iterator<Map.Entry<String, String>> iter) {
    super(new CollectionCursor<Map.Entry<String, String>>(iter));
  }

  @Override
  protected Namespace convert(Entry<String, String> next)
    throws StoreException
  {
    return new NamespaceImpl(next.getKey(), next.getValue());
  }
}
TOP

Related Classes of org.openrdf.sail.rdbms.cursor.NamespaceCursor

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.