Package org.openscience.cdk
Class DynamicFactory.ConstructorKey
java.lang.Object
org.openscience.cdk.DynamicFactory.ConstructorKey
- All Implemented Interfaces:
Comparable<DynamicFactory.ConstructorKey>
- Enclosing class:
- DynamicFactory
public abstract static class DynamicFactory.ConstructorKey
extends Object
implements Comparable<DynamicFactory.ConstructorKey>
A class which encapsulates the information about an interface (of this
implementation) and the parameter types of the constructor.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Orders constructor keys by the number of parameters and then this name.boolean
int
hashCode()
abstract Class<?>
intf()
Access the interface this key indexes.boolean
isAssignable
(DynamicFactory.ConstructorKey candidate) Checks whether this key is assignable to the candidate.boolean
Indicates whether this key has multiple parameters and they are of uniform type.abstract int
n()
Access the number of parameters in the constructor.toString()
abstract Class<?>
type
(int i) Access the type of class at the given parameter index.
-
Constructor Details
-
ConstructorKey
public ConstructorKey()
-
-
Method Details
-
intf
Access the interface this key indexes.- Returns:
- class of the interface
-
type
Access the type of class at the given parameter index.- Parameters:
i
- index of the parameter- Returns:
- class of the parameter at index
-
n
public abstract int n()Access the number of parameters in the constructor.- Returns:
- number of parameters
-
equals
-
isUniform
public boolean isUniform()Indicates whether this key has multiple parameters and they are of uniform type. If there are less then two types this method will return false.new Object[]{ Atom, Bond, Atom }
// falsenew Object[]{ Atom, Atom, Atom }
// true- Returns:
- whether the key is uniform
-
hashCode
public int hashCode() -
compareTo
Orders constructor keys by the number of parameters and then this name.- Specified by:
compareTo
in interfaceComparable<DynamicFactory.ConstructorKey>
- Parameters:
o
- another constructor key- Returns:
- whether the other key is greater than, less than or equal to this key
-
isAssignable
Checks whether this key is assignable to the candidate.- Parameters:
candidate
- another constructor key- Returns:
- whether the provided candidate is assignable
-
toString
-