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 Constructor Description ConstructorKey()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(DynamicFactory.ConstructorKey o)
Orders constructor keys by the number of parameters and then this name.boolean
equals(Object o)
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
isUniform()
Indicates whether this key has multiple parameters and they are of uniform type.abstract int
n()
Access the number of parameters in the constructor.String
toString()
abstract Class<?>
type(int i)
Access the type of class at the given parameter index.
-
-
-
Method Detail
-
intf
public abstract Class<?> intf()
Access the interface this key indexes.- Returns:
- class of the interface
-
type
public abstract Class<?> type(int i)
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
-
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
-
compareTo
public int compareTo(DynamicFactory.ConstructorKey o)
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
public boolean isAssignable(DynamicFactory.ConstructorKey candidate)
Checks whether this key is assignable to the candidate.- Parameters:
candidate
- another constructor key- Returns:
- whether the provided candidate is assignable
-
-