Class JDOSequence

  • All Implemented Interfaces:
    javax.jdo.datastore.Sequence, org.datanucleus.store.NucleusSequence

    public class JDOSequence
    extends java.lang.Object
    implements javax.jdo.datastore.Sequence, org.datanucleus.store.NucleusSequence
    Basic generic implementation of a JDO2 datastore sequence. Wraps a NucleusSequence.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.datanucleus.store.NucleusSequence sequence
      Underlying NucleusSequence.
    • Constructor Summary

      Constructors 
      Constructor Description
      JDOSequence​(org.datanucleus.store.NucleusSequence seq)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void allocate​(int additional)
      Method to allocate a set of elements.
      java.lang.Object current()
      Accessor for the current element.
      long currentValue()
      Accessor for the current element in the sequence as a long.
      java.lang.String getName()
      Accessor for the sequence name.
      java.lang.Object next()
      Accessor for the next element in the sequence.
      long nextValue()
      Accessor for the next element in the sequence as a long.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • sequence

        protected org.datanucleus.store.NucleusSequence sequence
        Underlying NucleusSequence.
    • Constructor Detail

      • JDOSequence

        public JDOSequence​(org.datanucleus.store.NucleusSequence seq)
        Constructor.
        Parameters:
        seq - Underlying sequence
    • Method Detail

      • getName

        public java.lang.String getName()
        Accessor for the sequence name.
        Specified by:
        getName in interface org.datanucleus.store.NucleusSequence
        Specified by:
        getName in interface javax.jdo.datastore.Sequence
        Returns:
        The sequence name
      • allocate

        public void allocate​(int additional)
        Method to allocate a set of elements.
        Specified by:
        allocate in interface org.datanucleus.store.NucleusSequence
        Specified by:
        allocate in interface javax.jdo.datastore.Sequence
        Parameters:
        additional - The number of additional elements to allocate
      • next

        public java.lang.Object next()
        Accessor for the next element in the sequence.
        Specified by:
        next in interface org.datanucleus.store.NucleusSequence
        Specified by:
        next in interface javax.jdo.datastore.Sequence
        Returns:
        The next element
      • nextValue

        public long nextValue()
        Accessor for the next element in the sequence as a long.
        Specified by:
        nextValue in interface org.datanucleus.store.NucleusSequence
        Specified by:
        nextValue in interface javax.jdo.datastore.Sequence
        Returns:
        The next element
        Throws:
        javax.jdo.JDODataStoreException - Thrown if not numeric
      • current

        public java.lang.Object current()
        Accessor for the current element.
        Specified by:
        current in interface org.datanucleus.store.NucleusSequence
        Specified by:
        current in interface javax.jdo.datastore.Sequence
        Returns:
        The current element.
      • currentValue

        public long currentValue()
        Accessor for the current element in the sequence as a long.
        Specified by:
        currentValue in interface org.datanucleus.store.NucleusSequence
        Specified by:
        currentValue in interface javax.jdo.datastore.Sequence
        Returns:
        The current element
        Throws:
        javax.jdo.JDODataStoreException - Thrown if not numeric