本文整理汇总了Java中java.util.Collections.emptyIterator方法的典型用法代码示例。如果您正苦于以下问题:Java Collections.emptyIterator方法的具体用法?Java Collections.emptyIterator怎么用?Java Collections.emptyIterator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.Collections
的用法示例。
在下文中一共展示了Collections.emptyIterator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: allColumnsInSelectOrder
import java.util.Collections; //导入方法依赖的package包/类
public Iterator<ColumnDefinition> allColumnsInSelectOrder()
{
final boolean isStaticCompactTable = isStaticCompactTable();
final boolean noNonPkColumns = isCompactTable() && CompactTables.hasEmptyCompactValue(this);
return new AbstractIterator<ColumnDefinition>()
{
private final Iterator<ColumnDefinition> partitionKeyIter = partitionKeyColumns.iterator();
private final Iterator<ColumnDefinition> clusteringIter = isStaticCompactTable ? Collections.<ColumnDefinition>emptyIterator() : clusteringColumns.iterator();
private final Iterator<ColumnDefinition> otherColumns = noNonPkColumns
? Collections.<ColumnDefinition>emptyIterator()
: (isStaticCompactTable
? partitionColumns.statics.selectOrderIterator()
: partitionColumns.selectOrderIterator());
protected ColumnDefinition computeNext()
{
if (partitionKeyIter.hasNext())
return partitionKeyIter.next();
if (clusteringIter.hasNext())
return clusteringIter.next();
return otherColumns.hasNext() ? otherColumns.next() : endOfData();
}
};
}
示例2: getImageReadersBySuffix
import java.util.Collections; //导入方法依赖的package包/类
/**
* Returns an <code>Iterator</code> containing all currently
* registered <code>ImageReader</code>s that claim to be able to
* decode files with the given suffix.
*
* @param fileSuffix a <code>String</code> containing a file
* suffix (<i>e.g.</i>, "jpg" or "tiff").
*
* @return an <code>Iterator</code> containing
* <code>ImageReader</code>s.
*
* @exception IllegalArgumentException if <code>fileSuffix</code>
* is <code>null</code>.
*
* @see javax.imageio.spi.ImageReaderSpi#getFileSuffixes
*/
public static Iterator<ImageReader>
getImageReadersBySuffix(String fileSuffix)
{
if (fileSuffix == null) {
throw new IllegalArgumentException("fileSuffix == null!");
}
// Ensure category is present
Iterator iter;
try {
iter = theRegistry.getServiceProviders(ImageReaderSpi.class,
new ContainsFilter(readerFileSuffixesMethod,
fileSuffix),
true);
} catch (IllegalArgumentException e) {
return Collections.emptyIterator();
}
return new ImageReaderIterator(iter);
}
示例3: getImageWritersByFormatName
import java.util.Collections; //导入方法依赖的package包/类
/**
* Returns an {@code Iterator} containing all currently
* registered {@code ImageWriter}s that claim to be able to
* encode the named format.
*
* @param formatName a {@code String} containing the informal
* name of a format (<i>e.g.</i>, "jpeg" or "tiff".
*
* @return an {@code Iterator} containing
* {@code ImageWriter}s.
*
* @exception IllegalArgumentException if {@code formatName} is
* {@code null}.
*
* @see javax.imageio.spi.ImageWriterSpi#getFormatNames
*/
public static Iterator<ImageWriter>
getImageWritersByFormatName(String formatName)
{
if (formatName == null) {
throw new IllegalArgumentException("formatName == null!");
}
Iterator<ImageWriterSpi> iter;
// Ensure category is present
try {
iter = theRegistry.getServiceProviders(ImageWriterSpi.class,
new ContainsFilter(writerFormatNamesMethod,
formatName),
true);
} catch (IllegalArgumentException e) {
return Collections.emptyIterator();
}
return new ImageWriterIterator(iter);
}
示例4: toValueIterator
import java.util.Collections; //导入方法依赖的package包/类
/**
* Returns an iterator over property values used in the {@code for each...in} statement. Aside from built-in JS
* objects, it also operates on Java arrays, any {@link Iterable}, as well as on {@link Map} objects, iterating over
* map values.
* @param obj object to iterate on.
* @return iterator over the object's property values.
*/
public static Iterator<?> toValueIterator(final Object obj) {
if (obj instanceof ScriptObject) {
return ((ScriptObject)obj).valueIterator();
}
if (obj instanceof JSObject) {
return ((JSObject)obj).values().iterator();
}
final Iterator<?> itr = iteratorForJavaArrayOrList(obj);
if (itr != null) {
return itr;
}
if (obj instanceof Map) {
return ((Map<?,?>)obj).values().iterator();
}
final Object wrapped = Global.instance().wrapAsObject(obj);
if (wrapped instanceof ScriptObject) {
return ((ScriptObject)wrapped).valueIterator();
}
return Collections.emptyIterator();
}
示例5: getImageWritersByMIMEType
import java.util.Collections; //导入方法依赖的package包/类
/**
* Returns an <code>Iterator</code> containing all currently
* registered <code>ImageWriter</code>s that claim to be able to
* encode files with the given MIME type.
*
* @param MIMEType a <code>String</code> containing a file
* suffix (<i>e.g.</i>, "image/jpeg" or "image/x-bmp").
*
* @return an <code>Iterator</code> containing <code>ImageWriter</code>s.
*
* @exception IllegalArgumentException if <code>MIMEType</code> is
* <code>null</code>.
*
* @see javax.imageio.spi.ImageWriterSpi#getMIMETypes
*/
public static Iterator<ImageWriter>
getImageWritersByMIMEType(String MIMEType)
{
if (MIMEType == null) {
throw new IllegalArgumentException("MIMEType == null!");
}
Iterator iter;
// Ensure category is present
try {
iter = theRegistry.getServiceProviders(ImageWriterSpi.class,
new ContainsFilter(writerMIMETypesMethod,
MIMEType),
true);
} catch (IllegalArgumentException e) {
return Collections.emptyIterator();
}
return new ImageWriterIterator(iter);
}
示例6: range
import java.util.Collections; //导入方法依赖的package包/类
public MemoryLRUCacheBytesIterator range(final String namespace, final Bytes from, final Bytes to) {
final NamedCache cache = getCache(namespace);
if (cache == null) {
return new MemoryLRUCacheBytesIterator(Collections.<Bytes>emptyIterator(), new NamedCache(namespace, this.metrics));
}
return new MemoryLRUCacheBytesIterator(cache.keyRange(from, to), cache);
}
示例7: properties
import java.util.Collections; //导入方法依赖的package包/类
@Override
public <V> Iterator<VertexProperty<V>> properties(String... propertyKeys) {
ArrayList<VertexProperty<V>> ans = new ArrayList<VertexProperty<V>>();
if (propertyKeys.length == 0) {
if (this.properties == null) return Collections.emptyIterator();
propertyKeys = this.properties.getPropertyKeys();
}
for (String key : propertyKeys) {
VertexProperty<V> prop = property(key);
if (prop.isPresent()) ans.add(prop);
}
return ans.iterator();
}
示例8: toPropertyIterator
import java.util.Collections; //导入方法依赖的package包/类
/**
* Returns an iterator over property identifiers used in the {@code for...in} statement. Note that the ECMAScript
* 5.1 specification, chapter 12.6.4. uses the terminology "property names", which seems to imply that the property
* identifiers are expected to be strings, but this is not actually spelled out anywhere, and Nashorn will in some
* cases deviate from this. Namely, we guarantee to always return an iterator over {@link String} values for any
* built-in JavaScript object. We will however return an iterator over {@link Integer} objects for native Java
* arrays and {@link List} objects, as well as arbitrary objects representing keys of a {@link Map}. Therefore, the
* expression {@code typeof i} within a {@code for(i in obj)} statement can return something other than
* {@code string} when iterating over native Java arrays, {@code List}, and {@code Map} objects.
* @param obj object to iterate on.
* @return iterator over the object's property names.
*/
public static Iterator<?> toPropertyIterator(final Object obj) {
if (obj instanceof ScriptObject) {
return ((ScriptObject)obj).propertyIterator();
}
if (obj != null && obj.getClass().isArray()) {
return new RangeIterator(Array.getLength(obj));
}
if (obj instanceof JSObject) {
return ((JSObject)obj).keySet().iterator();
}
if (obj instanceof List) {
return new RangeIterator(((List<?>)obj).size());
}
if (obj instanceof Map) {
return ((Map<?,?>)obj).keySet().iterator();
}
final Object wrapped = Global.instance().wrapAsObject(obj);
if (wrapped instanceof ScriptObject) {
return ((ScriptObject)wrapped).propertyIterator();
}
return Collections.emptyIterator();
}
示例9: getCompletions
import java.util.Collections; //导入方法依赖的package包/类
public Iterator<String> getCompletions(ParserContext context) {
int argIndex = argIndex(context);
CommandArgument<?> arg = arg(argIndex);
if (arg == null) {
return Collections.emptyIterator();
}
ArgumentContext argCtx = context.contextAt(argIndex);
if (!arg.validText(argCtx)) {
return Collections.emptyIterator();
}
return arg.getCompletions(argCtx);
}
示例10: all
import java.util.Collections; //导入方法依赖的package包/类
public MemoryLRUCacheBytesIterator all(final String namespace) {
final NamedCache cache = getCache(namespace);
if (cache == null) {
return new MemoryLRUCacheBytesIterator(Collections.<Bytes>emptyIterator(), new NamedCache(namespace, this.metrics));
}
return new MemoryLRUCacheBytesIterator(cache.allKeys(), cache);
}
示例11: call
import java.util.Collections; //导入方法依赖的package包/类
@Override
public Iterator<InventoryManifest.Locator> call(Iterator<InventoryReportLine> inventoryReport) throws IOException {
// Exclude the empty iterators which are caused by the mapPartitions
// when one partition only owns empty InventoryReportLine iterator after the filtering
if (!inventoryReport.hasNext()){
return Collections.emptyIterator();
}
List<InventoryReportLine> inventoryReportLineList = IteratorUtils.toList(inventoryReport);
InventoryReportLineWriter scvWriter = new InventoryReportLineWriter(s3ClientFactory.getValue().get(),
destBucket, destPrefix, srcBucket, manifestStorage);
return Collections.singletonList(scvWriter.writeCsvFile(inventoryReportLineList)).iterator();
}
示例12: iterator
import java.util.Collections; //导入方法依赖的package包/类
@Override
public Iterator<LogicalExpression> iterator() {
return Collections.emptyIterator();
}
示例13: iterator
import java.util.Collections; //导入方法依赖的package包/类
@Override
public Iterator<Prel> iterator() {
return Collections.emptyIterator();
}
示例14: locationsIterator
import java.util.Collections; //导入方法依赖的package包/类
public Iterator<URI> locationsIterator() {
return Collections.emptyIterator();
}
示例15: fetch
import java.util.Collections; //导入方法依赖的package包/类
@Override
public KeyValueIterator<Bytes, byte[]> fetch(Bytes keyFrom, Bytes keyTo, long from, long to) {
fetchCalled = true;
return new KeyValueIteratorStub<>(Collections.<KeyValue<Bytes, byte[]>>emptyIterator());
}