当前位置: 首页>>代码示例>>Java>>正文


Java IteratorUtil.asList方法代码示例

本文整理汇总了Java中org.neo4j.helpers.collection.IteratorUtil.asList方法的典型用法代码示例。如果您正苦于以下问题:Java IteratorUtil.asList方法的具体用法?Java IteratorUtil.asList怎么用?Java IteratorUtil.asList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.neo4j.helpers.collection.IteratorUtil的用法示例。


在下文中一共展示了IteratorUtil.asList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: nodeIdsInIndex

import org.neo4j.helpers.collection.IteratorUtil; //导入方法依赖的package包/类
private List<Long> nodeIdsInIndex( int indexId, String value ) throws IOException
{
    Config config = new Config();
    SchemaIndexProvider indexProvider = new LuceneSchemaIndexProvider( new DefaultFileSystemAbstraction(),
            DirectoryFactory.PERSISTENT, directory.graphDbDir() );
    IndexConfiguration indexConfig = new IndexConfiguration( false );
    IndexSamplingConfig samplingConfig = new IndexSamplingConfig( config );
    try ( IndexAccessor accessor = indexProvider.getOnlineAccessor( indexId, indexConfig, samplingConfig );
          IndexReader reader = accessor.newReader() )
    {
        return IteratorUtil.asList( reader.seek( value ) );
    }
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-lucene5-index,代码行数:14,代码来源:NonUniqueIndexTests.java

示例2: NeoConstraint

import org.neo4j.helpers.collection.IteratorUtil; //导入方法依赖的package包/类
public NeoConstraint(boolean constraint, boolean index, Iterable<String>propKeys, Label label, ConstraintType type) {
	this.constraint = constraint;
	this.index = index;
	this.type = type;
	this.propertyKeys = IteratorUtil.asList(propKeys);
	this.label = (label == null ? "N/A" : label.name());		
}
 
开发者ID:moxious,项目名称:neoprofiler,代码行数:8,代码来源:NeoConstraint.java

示例3: verifyThatIndexCreationTransactionIsTheFirstOne

import org.neo4j.helpers.collection.IteratorUtil; //导入方法依赖的package包/类
private void verifyThatIndexCreationTransactionIsTheFirstOne() throws Exception
{
    NeoStoreDataSource ds = db.getDependencyResolver().resolveDependency( NeoStoreDataSource.class );
    PhysicalLogFile pLogFile = db.getDependencyResolver().resolveDependency( PhysicalLogFile.class );
    long version = ds.getCurrentLogVersion();
    db.getDependencyResolver().resolveDependency( LogRotation.class ).rotateLogFile();
    db.getDependencyResolver().resolveDependency( CheckPointer.class ).forceCheckPoint(
            new SimpleTriggerInfo( "test" )
    );

    ReadableVersionableLogChannel logChannel = pLogFile.getReader( LogPosition.start( version ) );

    final AtomicBoolean success = new AtomicBoolean( false );

    try ( IOCursor<LogEntry> cursor = new LogEntryCursor( logChannel ) )
    {
        List<Command> commandsInFirstEntry = new ArrayList<>();
        boolean startFound = false;

        while ( cursor.next() )
        {
            LogEntry entry = cursor.get();

            if ( entry instanceof LogEntryStart )
            {
                if ( startFound )
                {
                    throw new IllegalArgumentException( "More than one start entry" );
                }
                startFound = true;
            }

            if ( startFound && entry instanceof LogEntryCommand )
            {
                commandsInFirstEntry.add( entry.<LogEntryCommand>as().getXaCommand() );
            }

            if ( entry instanceof LogEntryCommit )
            {
                // The first COMMIT
                assertTrue( startFound );
                assertFalse( "Index creation transaction wasn't the first one", commandsInFirstEntry.isEmpty() );
                List<Command> createCommands = IteratorUtil.asList( new FilteringIterator<>(
                        commandsInFirstEntry.iterator(),
                        new Predicate<Command>()
                        {
                            @Override
                            public boolean test( Command item )
                            {
                                return item instanceof IndexDefineCommand;

                            }
                        }
                ) );
                assertEquals( 1, createCommands.size() );
                success.set( true );
                break;
            }
        }
    }


    assertTrue( "Didn't find any commit record in log " + version, success.get() );
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-lucene5-index,代码行数:65,代码来源:IndexCreationTest.java

示例4: People

import org.neo4j.helpers.collection.IteratorUtil; //导入方法依赖的package包/类
public People(Iterator<String> names) {
    this.names = IteratorUtil.asList(names);
}
 
开发者ID:sarmbruster,项目名称:unmanaged-extension,代码行数:4,代码来源:People.java


注:本文中的org.neo4j.helpers.collection.IteratorUtil.asList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。