Remove exported everywhere.
[SquirrelJME.git] / modules / tool-classfile / src / main / java / net / multiphasicapps / classfile / InnerClass.java
blob90e9fd411dbac0f4b8efd3e7fe4552cecf708a9d
1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the GNU General Public License v3+, or later.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package net.multiphasicapps.classfile;
12 import cc.squirreljme.runtime.cldc.debug.Debugging;
14 /**
15 * This represents an inner class that is contained within an outer class, it
16 * is used by the compiler to determine how classes are contained within each
17 * other.
19 * @since 2018/05/15
21 public final class InnerClass
23 /** The name of the inner class. */
24 protected final ClassName name;
26 /** The outer class this is contained within. */
27 protected final ClassName outerclass;
29 /** The simple name of the class as defined in the class. */
30 protected final ClassIdentifier simplename;
32 /** The flags for the inner class. */
33 protected final InnerClassFlags flags;
35 /**
36 * Initializes an anonymous inner class.
38 * @param __n The name of the class.
39 * @param __f The class flags.
40 * @throws NullPointerException On null arguments.
41 * @since 2018/05/21
43 public InnerClass(ClassName __n, InnerClassFlags __f)
44 throws NullPointerException
46 if (__n == null || __f == null)
47 throw new NullPointerException("NARG");
49 this.name = __n;
50 this.outerclass = null;
51 this.simplename = null;
52 this.flags = __f;
55 /**
56 * Initializes a standard inner class.
58 * @param __n The name of the class.
59 * @param __o The class this is a member of. If this is {@code null} then
60 * the class is either: a top-level class/interface, a local class (one
61 * that exists only in a method), or is a member of an anonymous class.
62 * @param __i The identifier used to name the class.
63 * @param __f The class flags.
64 * @since 2018/05/21
66 public InnerClass(ClassName __n, ClassName __o, ClassIdentifier __i,
67 InnerClassFlags __f)
69 this.name = __n;
70 this.outerclass = __o;
71 this.simplename = __i;
72 this.flags = __f;
75 /**
76 * {@inheritDoc}
77 * @since 2018/05/15
79 @Override
80 public final boolean equals(Object __o)
82 throw Debugging.todo();
85 /**
86 * Returns the flags for the inner class.
88 * @return The inner class flags.
89 * @since 2018/06/16
91 public final InnerClassFlags flags()
93 return this.flags;
96 /**
97 * {@inheritDoc}
98 * @since 2018/05/15
100 @Override
101 public final int hashCode()
103 throw Debugging.todo();
107 * Is this an anonymous class?
109 * @return Is this an anonymous class?
110 * @since 2018/06/16
112 public final boolean isAnonymous()
114 return this.name != null &&
115 this.outerclass == null &&
116 this.simplename == null;
120 * Returns the name of this class.
122 * @return The class name.
123 * @since 2018/06/16
125 public final ClassName name()
127 return this.name;
131 * Returns the name of the outer class or {@code null} if it is anonymous.
133 * @return The name of the outer class or {@code null} if anonymous.
134 * @since 2018/06/16
136 public final ClassName outerClass()
138 return this.outerclass;
142 * Returns the simple name of the class.
144 * @return The simple name of the class.
145 * @since 2018/06/16
147 public final ClassIdentifier simpleName()
149 return this.simplename;
153 * {@inheritDoc}
154 * @since 2018/05/15
156 @Override
157 public final String toString()
159 throw Debugging.todo();