01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /**
19: * @author Vladimir N. Molotkov, Stepan M. Mishura
20: * @version $Revision$
21: */package org.apache.harmony.security.asn1;
22:
23: import java.util.Collection;
24:
25: /**
26: * This abstract class represents ASN.1 collection type.
27: *
28: * The value for such type is a collection of zero or
29: * more occurrences of a provided type.
30: *
31: * @see http://asn1.elibel.tm.fr/en/standards/index.htm
32: */
33:
34: public abstract class ASN1ValueCollection extends ASN1Constructured {
35:
36: /**
37: * A value collection of this ASN.1 type
38: */
39: public final ASN1Type type;
40:
41: /**
42: * Constructs ASN1 collection type.
43: *
44: * @param tagNumber - ASN.1 tag number
45: * @param type - ASN.1 type
46: */
47: public ASN1ValueCollection(int tagNumber, ASN1Type type) {
48: super (tagNumber);
49:
50: this .type = type;
51: }
52:
53: /**
54: * Provides an object's values to be encoded
55: *
56: * Derived classes should override this method to provide
57: * encoding for a selected class of objects.
58: *
59: * @param - an object to be encoded
60: * @return - a collection of object's values to be encoded
61: */
62: public Collection getValues(Object object) {
63: return (Collection) object;
64: }
65: }
|