Documentation of 'edu.rit.hyb.prime.Prime32List' Java class
Prime32List
edu.rit.hyb.prime

Class Prime32List



  • public class Prime32List
    extends java.lang.Object
    Class Prime32List encapsulates a list of 32-bit prime numbers. The list of prime numbers is obtained by reading a sequence of values from a file. Each value is an unsigned byte. Each value is the difference between two consecutive odd primes, divided by 2. The file must be created by the Prime32File program.

    Class Prime32List provides a method for creating an iterator. The numbers returned by the iterator are the odd primes in ascending order: 3, 5, 7, 11, and so on. The numbers are returned as type long. Once the iterator has read all numbers from the prime file, the iterator returns 0 to signal that there are no more numbers.

    • Constructor Summary

      Constructors 
      Constructor and Description
      Prime32List(java.io.File primeFile)
      Construct a new 32-bit prime list.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      LongIterator iterator()
      Obtain an iterator for the primes in this 32-bit prime list.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Prime32List

        public Prime32List(java.io.File primeFile)
        Construct a new 32-bit prime list. The prime numbers are contained in the given file.
        Parameters:
        primeFile - Prime file.
    • Method Detail

      • iterator

        public LongIterator iterator()
                              throws java.io.IOException
        Obtain an iterator for the primes in this 32-bit prime list.
        Returns:
        Iterator.
        Throws:
        java.io.IOException - Thrown if an I/O error occurred.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.