For the latest news and information visit
The GNU Crypto project

gnu.crypto.util
Class Sequence

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by gnu.crypto.util.Sequence
All Implemented Interfaces:
Iterable, Collection, List

public final class Sequence
extends AbstractList

A monotonic sequence of integers in the finite field 232.


Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Sequence(int end)
          Create a sequence of integers from 0 to end, with an increment of 1.
Sequence(int start, int end)
          Create a sequence of integers from start to end, with an increment of 1.
Sequence(int start, int end, int span)
          Create a sequence of integers from start to end, with an increment of span.
 
Method Summary
 Object get(int index)
           
 int size()
           
 Object[] toArray()
           
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray
 

Constructor Detail

Sequence

public Sequence(int end)
Create a sequence of integers from 0 to end, with an increment of 1. If end is less than 0, then the sequence will wrap around through all positive integers then negative integers until the end value is reached. Naturally, this will result in an enormous object, so don't do this.

Parameters:
end - The ending value.

Sequence

public Sequence(int start,
                int end)
Create a sequence of integers from start to end, with an increment of 1. If end is less than start, then the sequence will wrap around until the end value is reached. Naturally, this will result in an enormous object, so don't do this.

Parameters:
start - The starting value.
end - The ending value.

Sequence

public Sequence(int start,
                int end,
                int span)
Create a sequence of integers from start to end, with an increment of span. If end is less than start, then the sequence will wrap around until the end value is reached. Naturally, this will result in an enormous object, so don't do this.

span can be negative, resulting in a decresing sequence.

If span is 0, then the sequence will contain {start, end} if start != end, or just the singleton start if start == end.

Parameters:
start - The starting value.
end - The ending value.
span - The increment value.
Method Detail

get

public Object get(int index)
Specified by:
get in interface List
Specified by:
get in class AbstractList

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface List
Specified by:
size in class AbstractCollection

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List
Overrides:
toArray in class AbstractCollection

For the latest news and information visit
The GNU Crypto project

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.