Search in sources :

Example 1 with PersistentEntityId

use of jetbrains.exodus.entitystore.PersistentEntityId in project xodus by JetBrains.

the class EntityIdArrayIteratorMultiTypeIdUnpacked method nextId.

@Override
@Nullable
public EntityId nextId() {
    // for better performance of cached iterables, this method copies the nextIdImpl()
    // without try-catch block since it actually throws nothing
    final int index = this.index++;
    final int typeId = typeIds[index];
    return typeId == NULL_TYPE_ID ? null : new PersistentEntityId(typeId, localIds[index]);
}
Also used : PersistentEntityId(jetbrains.exodus.entitystore.PersistentEntityId) Nullable(org.jetbrains.annotations.Nullable)

Example 2 with PersistentEntityId

use of jetbrains.exodus.entitystore.PersistentEntityId in project xodus by JetBrains.

the class EntityIdArrayIteratorMultiTypeIdUnpacked method nextIdImpl.

@Override
@Nullable
public EntityId nextIdImpl() {
    final int index = this.index++;
    final int typeId = typeIds[index];
    return typeId == NULL_TYPE_ID ? null : new PersistentEntityId(typeId, localIds[index]);
}
Also used : PersistentEntityId(jetbrains.exodus.entitystore.PersistentEntityId) Nullable(org.jetbrains.annotations.Nullable)

Example 3 with PersistentEntityId

use of jetbrains.exodus.entitystore.PersistentEntityId in project xodus by JetBrains.

the class EntityIdArrayIteratorMultiTypeIdPacked method nextId.

@Override
@Nullable
public EntityId nextId() {
    // for better performance of cached iterables, this method copies the nextIdImpl()
    // without try-catch block since it actually throws nothing
    final int index = this.index++;
    if (index >= currentBound) {
        typeId = typeIds[typeIndex];
        ++typeIndex;
        currentBound = typeIds[typeIndex];
        ++typeIndex;
    }
    return typeId == NULL_TYPE_ID ? null : new PersistentEntityId(typeId, localIds[index]);
}
Also used : PersistentEntityId(jetbrains.exodus.entitystore.PersistentEntityId) Nullable(org.jetbrains.annotations.Nullable)

Example 4 with PersistentEntityId

use of jetbrains.exodus.entitystore.PersistentEntityId in project xodus by JetBrains.

the class ReverseEntityIdArrayIteratorMultiTypeIdPacked method nextIdImpl.

@Override
@Nullable
public EntityId nextIdImpl() {
    final int index = --this.index;
    if (index < currentBound) {
        --typeIndex;
        typeId = typeIds[typeIndex];
        if (typeIndex > 0) {
            --typeIndex;
            currentBound = typeIds[typeIndex];
        } else {
            currentBound = 0;
        }
    }
    return typeId == NULL_TYPE_ID ? null : new PersistentEntityId(typeId, localIds[index]);
}
Also used : PersistentEntityId(jetbrains.exodus.entitystore.PersistentEntityId) Nullable(org.jetbrains.annotations.Nullable)

Example 5 with PersistentEntityId

use of jetbrains.exodus.entitystore.PersistentEntityId in project xodus by JetBrains.

the class ReverseEntityIdArrayIteratorMultiTypeIdPacked method nextId.

@Override
@Nullable
public EntityId nextId() {
    // for better performance of cached iterables, this method copies the nextIdImpl()
    // without try-catch block since it actually throws nothing
    final int index = --this.index;
    if (index < currentBound) {
        --typeIndex;
        typeId = typeIds[typeIndex];
        if (typeIndex > 0) {
            --typeIndex;
            currentBound = typeIds[typeIndex];
        } else {
            currentBound = 0;
        }
    }
    return typeId == NULL_TYPE_ID ? null : new PersistentEntityId(typeId, localIds[index]);
}
Also used : PersistentEntityId(jetbrains.exodus.entitystore.PersistentEntityId) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

PersistentEntityId (jetbrains.exodus.entitystore.PersistentEntityId)9 Nullable (org.jetbrains.annotations.Nullable)8 ArrayList (java.util.ArrayList)1 IntHashMap (jetbrains.exodus.core.dataStructures.hash.IntHashMap)1 EntityIterableType (jetbrains.exodus.entitystore.EntityIterableType)1 EntityStoreTestBase (jetbrains.exodus.entitystore.EntityStoreTestBase)1 PersistentStoreTransaction (jetbrains.exodus.entitystore.PersistentStoreTransaction)1 jetbrains.exodus.entitystore.iterate.binop (jetbrains.exodus.entitystore.iterate.binop)1