All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.permazen.core.util.ObjIdQueue Maven / Gradle / Ivy

Go to download

Permazen core API classes which provide objects, fields, indexes, queries, and schema management on top of a key/value store.

The newest version!

/*
 * Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
 */

package io.permazen.core.util;

import io.permazen.core.ObjId;

import java.util.NoSuchElementException;

import javax.annotation.concurrent.NotThreadSafe;

/**
 * A queue of {@link ObjId}'s, where {@link ObjId}'s can be added or removed one at a time.
 *
 * 

* Instances allow duplicates. * *

* Instances are not thread safe. * * @see ObjIdQueues */ @NotThreadSafe public interface ObjIdQueue { /** * Add an {@link ObjId} to this queue. * * @param id the {@link ObjId} to add * @throws IllegalArgumentException if {@code id} is null * @throws IllegalStateException if the maximum capacity is exceeded */ void add(ObjId id); /** * Remove and return the next {@link ObjId} from this queue. * * @return the next {@link ObjId} * @throws NoSuchElementException if this queue is empty */ ObjId next(); /** * Get the number of {@link ObjId}'s in this queue. * * @return current size */ int size(); /** * Determine whether this instance is empty. * * @return true if empty, otherwise false */ boolean isEmpty(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy