diff options
| author | Raif S. Naffah <raif@swiftdsl.com.au> | 2006-06-24 00:09:26 +0000 |
|---|---|---|
| committer | Raif S. Naffah <raif@swiftdsl.com.au> | 2006-06-24 00:09:26 +0000 |
| commit | c6a7fb5cb0459d9cfdb13834868c4b3c87fa7b7e (patch) | |
| tree | 25d8bec8afc47cbf7f95d62517939fbbf1383a87 /gnu/java/security/util/SimpleList.java | |
| parent | 6c181a1fd8daf166b48fa352fb3d8963d182c3d5 (diff) | |
| download | classpath-c6a7fb5cb0459d9cfdb13834868c4b3c87fa7b7e.tar.gz | |
2006-06-24 Raif S. Naffah <raif@swiftdsl.com.au>
* gnu/java/security/util/Util.java: Source formatting.
* gnu/java/security/util/SimpleList.java: Likewise.
* gnu/java/security/util/Sequence.java: Likewise.
* gnu/java/security/util/PRNG.java: Likewise.
* gnu/java/security/util/ExpirableObject.java: Likewise.
* gnu/java/security/util/Base64.java: Likewise.
* gnu/java/security/sig/SignatureFactory.java: Likewise.
* gnu/java/security/sig/ISignatureCodec.java: Likewise.
* gnu/java/security/sig/ISignature.java: Likewise.
* gnu/java/security/sig/BaseSignature.java: Likewise.
* gnu/java/security/sig/rsa/RSAPSSSignatureRawCodec.java: Likewise.
* gnu/java/security/sig/rsa/RSAPSSSignature.java: Likewise.
* gnu/java/security/sig/rsa/RSAPKCS1V1_5Signature.java: Likewise.
* gnu/java/security/sig/rsa/RSA.java: Likewise.
* gnu/java/security/sig/rsa/EMSA_PSS.java: Likewise.
* gnu/java/security/sig/rsa/EMSA_PKCS1_V1_5.java: Likewise.
* gnu/java/security/sig/rsa/EME_PKCS1_V1_5.java: Likewise.
* gnu/java/security/sig/dss/DSSSignatureRawCodec.java: Likewise.
* gnu/java/security/sig/dss/DSSSignature.java: Likewise.
* gnu/java/security/provider/X509CertificateFactory.java: Likewise.
* gnu/java/security/provider/PKIXCertPathValidatorImpl.java: Likewise.
* gnu/java/security/provider/Gnu.java: Likewise.
* gnu/java/security/prng/RandomEventListener.java: Likewise.
* gnu/java/security/prng/RandomEvent.java: Likewise.
* gnu/java/security/prng/PRNGFactory.java: Likewise.
* gnu/java/security/prng/MDGenerator.java: Likewise.
* gnu/java/security/prng/LimitReachedException.java: Likewise.
* gnu/java/security/prng/IRandom.java: Likewise.
* gnu/java/security/prng/EntropySource.java: Likewise.
* gnu/java/security/prng/BasePRNG.java: Likewise.
Diffstat (limited to 'gnu/java/security/util/SimpleList.java')
| -rw-r--r-- | gnu/java/security/util/SimpleList.java | 48 |
1 files changed, 16 insertions, 32 deletions
diff --git a/gnu/java/security/util/SimpleList.java b/gnu/java/security/util/SimpleList.java index 8636b4e14..74f3bafce 100644 --- a/gnu/java/security/util/SimpleList.java +++ b/gnu/java/security/util/SimpleList.java @@ -43,24 +43,18 @@ import java.util.Collection; import java.util.Iterator; /** - * A simple way to create immutable n-tuples. This class can be created with - * up to four elements specified via one of the constructors, or with a - * collection of arbitrary size. + * A simple way to create immutable n-tuples. This class can be created with up + * to four elements specified via one of the constructors, or with a collection + * of arbitrary size. */ -public final class SimpleList extends AbstractList +public final class SimpleList + extends AbstractList { - - // Fields. - // ------------------------------------------------------------------------ - private final Object[] elements; - // Constructors. - // ------------------------------------------------------------------------ - /** * Create a singleton list. - * + * * @param element The first element. */ public SimpleList(final Object element) @@ -71,7 +65,7 @@ public final class SimpleList extends AbstractList /** * Create an ordered pair (2-tuple). - * + * * @param e1 The first element. * @param e2 The second element. */ @@ -84,7 +78,7 @@ public final class SimpleList extends AbstractList /** * Create a 3-tuple. - * + * * @param e1 The first element. * @param e2 The second element. * @param e3 The third element. @@ -99,7 +93,7 @@ public final class SimpleList extends AbstractList /** * Create a 4-tuple. - * + * * @param e1 The first element. * @param e2 The second element. * @param e3 The third element. @@ -124,10 +118,10 @@ public final class SimpleList extends AbstractList } /** - * Create an n-tuple of arbitrary size. Even if the supplied collection has - * no natural order, the created n-tuple will have the order that the - * elements are returned by the collection's iterator. - * + * Create an n-tuple of arbitrary size. Even if the supplied collection has no + * natural order, the created n-tuple will have the order that the elements + * are returned by the collection's iterator. + * * @param c The collection. */ public SimpleList(Collection c) @@ -135,14 +129,9 @@ public final class SimpleList extends AbstractList elements = new Object[c.size()]; int i = 0; for (Iterator it = c.iterator(); it.hasNext() && i < elements.length;) - { - elements[i++] = it.next(); - } + elements[i++] = it.next(); } - // Instance methods. - // ------------------------------------------------------------------------ - public int size() { if (elements == null) @@ -153,14 +142,9 @@ public final class SimpleList extends AbstractList public Object get(int index) { if (elements == null) - { - throw new IndexOutOfBoundsException("list is empty"); - } + throw new IndexOutOfBoundsException("list is empty"); if (index < 0 || index >= elements.length) - { - throw new IndexOutOfBoundsException("index=" + index + ", size=" - + size()); - } + throw new IndexOutOfBoundsException("index=" + index + ", size=" + size()); return elements[index]; } |
