1/*
2 * ProGuard -- shrinking, optimization, obfuscation, and preverification
3 *             of Java bytecode.
4 *
5 * Copyright (c) 2002-2014 Eric Lafortune (eric@graphics.cornell.edu)
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation; either version 2 of the License, or (at your option)
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21package proguard.classfile.attribute;
22
23import proguard.classfile.*;
24
25/**
26 * Representation of a parameter, as defined in a method parameters
27 * attribute.
28 *
29 * @author Eric Lafortune
30 */
31public class ParameterInfo implements VisitorAccepter
32{
33    public int u2nameIndex;
34    public int u2accessFlags;
35
36    /**
37     * An extra field in which visitors can store information.
38     */
39    public Object visitorInfo;
40
41
42    /**
43     * Creates an uninitialized ParameterInfo.
44     */
45    public ParameterInfo()
46    {
47    }
48
49
50    /**
51     * Creates an initialized ParameterInfo.
52     */
53    public ParameterInfo(int u2nameIndex,
54                         int u2accessFlags)
55    {
56        this.u2nameIndex   = u2nameIndex;
57        this.u2accessFlags = u2accessFlags;
58    }
59
60
61    /**
62     * Returns the parameter name.
63     */
64    public String getName(Clazz clazz)
65    {
66        return clazz.getString(u2nameIndex);
67    }
68
69
70    // Implementations for VisitorAccepter.
71
72    public Object getVisitorInfo()
73    {
74        return visitorInfo;
75    }
76
77    public void setVisitorInfo(Object visitorInfo)
78    {
79        this.visitorInfo = visitorInfo;
80    }
81}
82