001: // This file is part of KeY - Integrated Deductive Software Design
002: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
003: // Universitaet Koblenz-Landau, Germany
004: // Chalmers University of Technology, Sweden
005: //
006: // The KeY system is protected by the GNU General Public License.
007: // See LICENSE.TXT for details.
008: //
009: //
010:
011: package de.uka.ilkd.key.java.abstraction;
012:
013: import de.uka.ilkd.key.util.ExtList;
014:
015: /**
016: Default constructor of class types.
017: */
018: public class DefaultConstructor implements Constructor {
019:
020: protected final String name;
021: protected final boolean parentIsPublic;
022:
023: //???use ProgramElementName instead of name?????
024: public DefaultConstructor(ExtList children) {
025: name = (String) children.get(String.class);
026: parentIsPublic = ((Boolean) children.get(Boolean.class))
027: .booleanValue();
028: }
029:
030: /**
031: Create a new default constructor for the given class type.
032: The name of the constructor is set appropriately.
033: @param name of the Constructor
034: @param parentIsPublic is set true iff the parent is declared public.
035: */
036: public DefaultConstructor(String name, boolean parentIsPublic) {
037: this .parentIsPublic = parentIsPublic;
038: this .name = name;
039: }
040:
041: /**
042: Checks if this member is final.
043: @return <CODE>false</CODE>.
044: */
045: public boolean isFinal() {
046: return false;
047: }
048:
049: /**
050: Checks if this member is static.
051: @return <CODE>true</CODE>.
052: */
053: public boolean isStatic() {
054: return true;
055: }
056:
057: /**
058: Checks if this member is private.
059: @return <CODE>false</CODE>.
060: */
061: public boolean isPrivate() {
062: return false;
063: }
064:
065: /**
066: Checks if this member is protected.
067: @return <CODE>false</CODE>.
068: */
069: public boolean isProtected() {
070: return false;
071: }
072:
073: /**
074: Checks if this member is public.
075: @return <CODE>true</CODE>, if the containing class type is public,
076: <CODE>false</CODE> otherwise.
077: */
078: public boolean isPublic() {
079: return parentIsPublic;
080: // else, it is package visible
081: }
082:
083: /**
084: Checks if this member is protected.
085: @return <CODE>false</CODE>.
086: */
087: public boolean isStrictFp() {
088: return false;
089: }
090:
091: /**
092: Checks if this member is abstract.
093: @return <CODE>false</CODE>.
094: */
095: public boolean isAbstract() {
096: return false;
097: }
098:
099: /**
100: Checks if this member is native.
101: @return <CODE>false</CODE>.
102: */
103: public boolean isNative() {
104: return false;
105: }
106:
107: /**
108: Checks if this member is synchronized.
109: @return <CODE>false</CODE>.
110: */
111: public boolean isSynchronized() {
112: return false;
113: }
114:
115: /** TO BE IMPLEMENTED
116: Returns the signature of this constructor.
117: @return the signature of this constructor.
118: */
119: public Type[] getSignature() {
120: return new Type[0];
121: }
122:
123: /**
124: Returns the return type of this method.
125: @return the return type of this method.
126: */
127: public Type getReturnType() {
128: return null;
129: }
130:
131: /**
132: Returns the (empty) exception list of this constructor.
133: @return the (empty) exception list of this constructor.
134: */
135: public ClassType[] getExceptions() {
136: return new ClassType[0];
137: }
138:
139: /** TO BE IMPLEMENTED
140: Returns the package this element is defined in.
141: @return the package of this element.
142: */
143: public Package getPackage() {
144: return null;
145: }
146:
147: /** TO BE IMPLEMENTED
148: Returns the (empty) list of class types locally defined within this
149: container.
150: @return a list of contained class types.
151: */
152: public ClassType[] getTypes() {
153: return new ClassType[0];
154: }
155:
156: /**
157: Returns the name of this element.
158: @return the name of this element.
159: */
160: public String getName() {
161: return name;
162: }
163:
164: /**
165: Returns the name of this element.
166: @return the name of this element.
167: */
168: public String getFullName() {
169: return name;
170: }
171: }
|