gnu.crypto.util

Class Sequence


public final class Sequence
extends AbstractList

A monotonic sequence of integers in the finite field 232.

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()

Constructor Details

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 Details

get

public Object get(int index)

size

public int size()

toArray

public Object[] toArray()

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