Class DefaultElementFactory

    • Constructor Detail

      • DefaultElementFactory

        public DefaultElementFactory()
        Creates a new element factory.
    • Method Detail

      • getElementForType

        public Element getElementForType​(String type)
        Returns an element for the specified type. This implementation assumes, that all elements have a public default constructor and uses Class.newInstance() to create a new instance of that element.
        Specified by:
        getElementForType in interface ElementFactory
        Parameters:
        type - the type.
        Returns:
        The element.
      • equals

        public boolean equals​(Object o)
        Compares this object with the given object for equality. The object will be considered equal if it is a element factory and contains the same elements.
        Overrides:
        equals in class Object
        Parameters:
        o - the object that should be compared.
        Returns:
        true, if the given object is equal, false otherwise.
        See Also:
        Object.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        Computes an hashcode for this factory.
        Overrides:
        hashCode in class Object
        Returns:
        the hashcode.
        See Also:
        Object.hashCode()