org.mockcentral.editor.search
Class MatchingType

java.lang.Object
  extended by org.mockcentral.editor.search.MatchingType

public class MatchingType
extends java.lang.Object

A class used to record information about a found java element following a search done by a SearchEngine. This bean-style class stores and accesses the modifiers, package name, simple name and enclosing type names for the element. In addition, it creates a label field used for displaying the instance within controls. If the element is a member element, this label will include the enclosing type names, otherwise it will correspond to the simple type name.

Author:
David Hutchinson

Constructor Summary
protected MatchingType(int modifiers, char[] packageNameChars, char[] simpleTypeNameChars, char[][] enclosingTypesChars)
          Creates a new instance from the parameters.
protected MatchingType(int modifiers, java.lang.String packageNameChars, java.lang.String simpleTypeNameChars, java.lang.String[] enclosingTypes)
          Creates a new instance from the parameters.
 
Method Summary
 boolean equals(java.lang.Object o)
           
protected  java.lang.String[] getEnclosingTypes()
          Returns a String array containing the type's enclosing types.
protected  java.lang.String getLabel()
          Returns a String used for labelling the type within controls.
protected  int getModifiers()
          Returns the int designating the type's modifiers.
protected  java.lang.String getPackageName()
          Returns the type's package name.
protected  java.lang.String getSimpleTypeName()
          Returns the type's name.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatchingType

protected MatchingType(int modifiers,
                       char[] packageNameChars,
                       char[] simpleTypeNameChars,
                       char[][] enclosingTypesChars)
Creates a new instance from the parameters.

Parameters:
modifiers - an int designating the type's modifiers.
packageNameChars - a char array designating the type's package name.
simpleTypeNameChars - a char array designating the type's name.
enclosingTypesChars - a char array designating the type's enclosing type names.

MatchingType

protected MatchingType(int modifiers,
                       java.lang.String packageNameChars,
                       java.lang.String simpleTypeNameChars,
                       java.lang.String[] enclosingTypes)
Creates a new instance from the parameters.

Parameters:
modifiers - an int designating the type's modifiers.
packageNameChars - a String designating the type's package name.
simpleTypeNameChars - a String designating the type's name.
enclosingTypes - a String array designating the type's enclosing type names.
Method Detail

getModifiers

protected int getModifiers()
Returns the int designating the type's modifiers.

Returns:
the int designating the type's modifiers.

getPackageName

protected java.lang.String getPackageName()
Returns the type's package name.

Returns:
the type's package name.

getSimpleTypeName

protected java.lang.String getSimpleTypeName()
Returns the type's name.

Returns:
the type's name.

getEnclosingTypes

protected java.lang.String[] getEnclosingTypes()
Returns a String array containing the type's enclosing types.

Returns:
a String array containing the type's enclosing types.

getLabel

protected java.lang.String getLabel()
Returns a String used for labelling the type within controls. If the type is a member type, this will be the type's name prepended by its enclosing types, otherwise it will simply be its name.

Returns:
a String used for labelling the type within controls.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object