public static <T> NullIterator<T> instance() { return new NullIterator<T>(); }
/** * Answer an iterator over all of the values for the given key. An iterator * is always supplied, even if the key is not present. * * @param key The key object * @return An iterator over all of the values for this key in the map */ public Iterator<To> getAll( Object key ) { List<To> entry = m_table.get( key ); return (entry != null) ? entry.iterator() : new NullIterator<To>(); }
/** * Return the derivation of at triple. * The derivation is a List of DerivationRecords */ @Override public Iterator<Derivation> getDerivation(Triple t) { if (derivations == null) { return new NullIterator<Derivation>(); } else { return derivations.getAll(t); } }
/** * Return the derivation of at triple. * The derivation is a List of DerivationRecords */ @Override public Iterator<Derivation> getDerivation(Triple t) { if (derivations == null) { return new NullIterator<Derivation>(); } else { return derivations.getAll(t); } }
/** * Basic pattern lookup interface. * @param pattern a TriplePattern to be matched against the data * @return a ClosableIterator over all Triples in the data set * that match the pattern */ @Override public ExtendedIterator<Triple> find(TriplePattern pattern) { if (graph == null) return new NullIterator<Triple>(); return graph.find(pattern.asTripleMatch()); }
@Override public ExtendedIterator<Triple> graphBaseFind(final Triple pattern) { try { return WrappedIterator.createNoRemove(query(pattern)); } catch (final SyntaxError exception) { logger().error(MessageCatalog._00113_NWS_FAILURE, exception); return new NullIterator<Triple>(); } }
/** * Extended find interface used in situations where the implementator * may or may not be able to answer the complete query. It will * attempt to answer the pattern but if its answers are not known * to be complete then it will also pass the request on to the nested * Finder to append more results. * @param pattern a TriplePattern to be matched against the data * @param continuation either a Finder or a normal Graph which * will be asked for additional match results if the implementor * may not have completely satisfied the query. */ @Override public ExtendedIterator<Triple> findWithContinuation(TriplePattern pattern, Finder continuation) { if (graph == null) return new NullIterator<Triple>(); if (continuation == null) { return graph.find(pattern.asTripleMatch()); } else { return graph.find(pattern.asTripleMatch()).andThen(continuation.find(pattern)); } }
/** * <p> * Answer an iterator that ranges over the properties in this model that are declared * to be annotation properties. Not all supported languages define annotation properties * (the category of annotation properties is chiefly an OWL innovation). * </p> * <p> * <strong>Note:</strong> the number of nodes returned by this iterator will vary according to * the completeness of the deductive extension of the underlying graph. See class * overview for more details. * </p> * * @return An iterator over annotation properties. * @see Profile#getAnnotationProperties() */ @Override public ExtendedIterator<AnnotationProperty> listAnnotationProperties() { checkProfileEntry( getProfile().ANNOTATION_PROPERTY(), "ANNOTATION_PROPERTY" ); Resource r = getProfile().ANNOTATION_PROPERTY(); if (r == null) { return new NullIterator<AnnotationProperty>(); } else { return findByType( r ) .mapWith( new SubjectNodeAs<AnnotationProperty>( AnnotationProperty.class ) ) .filterKeep( new UniqueFilter<AnnotationProperty>()); } }