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 Details

    • ConstructorKey

      public ConstructorKey()
  • Method Details

    • 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
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • 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 } // false new Object[]{ Atom, Atom, Atom } // true
      Returns:
      whether the key is uniform
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(DynamicFactory.ConstructorKey o)
      Orders constructor keys by the number of parameters and then this name.
      Specified by:
      compareTo in interface Comparable<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
    • toString

      public String toString()
      Overrides:
      toString in class Object