當前位置: 首頁>>代碼示例>>Java>>正文


Java Collections.emptyIterator方法代碼示例

本文整理匯總了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();
        }
    };
}
 
開發者ID:Netflix,項目名稱:sstable-adaptor,代碼行數:27,代碼來源:CFMetaData.java

示例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);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:35,代碼來源:ImageIO.java

示例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);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:35,代碼來源:ImageIO.java

示例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();
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:33,代碼來源:ScriptRuntime.java

示例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);
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:34,代碼來源:ImageIO.java

示例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);
}
 
開發者ID:YMCoding,項目名稱:kafka-0.11.0.0-src-with-comment,代碼行數:8,代碼來源:ThreadCache.java

示例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();
}
 
開發者ID:lambdazen,項目名稱:bitsy,代碼行數:16,代碼來源:BitsyVertex.java

示例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();
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:41,代碼來源:ScriptRuntime.java

示例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);
}
 
開發者ID:kenzierocks,項目名稱:HardVox,代碼行數:13,代碼來源:CommandParser.java

示例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);
}
 
開發者ID:YMCoding,項目名稱:kafka-0.11.0.0-src-with-comment,代碼行數:8,代碼來源:ThreadCache.java

示例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();
}
 
開發者ID:awslabs,項目名稱:s3-inventory-usage-examples,代碼行數:13,代碼來源:WriteNewInventoryReportFunc.java

示例12: iterator

import java.util.Collections; //導入方法依賴的package包/類
@Override
public Iterator<LogicalExpression> iterator() {
  return Collections.emptyIterator();
}
 
開發者ID:dremio,項目名稱:dremio-oss,代碼行數:5,代碼來源:ValueExpressions.java

示例13: iterator

import java.util.Collections; //導入方法依賴的package包/類
@Override
public Iterator<Prel> iterator() {
  return Collections.emptyIterator();
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:5,代碼來源:ScanPrel.java

示例14: locationsIterator

import java.util.Collections; //導入方法依賴的package包/類
public Iterator<URI> locationsIterator() {
    return Collections.emptyIterator();
}
 
開發者ID:uhh-lt,項目名稱:LT-ABSA,代碼行數:4,代碼來源:ListDoubleSplit.java

示例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());
}
 
開發者ID:YMCoding,項目名稱:kafka-0.11.0.0-src-with-comment,代碼行數:6,代碼來源:SegmentedBytesStoreStub.java


注:本文中的java.util.Collections.emptyIterator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。