Class AttributeDataTypeRestriction

  • All Implemented Interfaces:
    AttributeRestriction

    @Data
    public class AttributeDataTypeRestriction
    extends Object
    implements AttributeRestriction
    Restriction that an unbound Attribute-Variable in an assignment rule must be part of a DataType.
    • Constructor Detail

      • AttributeDataTypeRestriction

        public AttributeDataTypeRestriction​(DataType requiredContainingDataType)
    • Method Detail

      • doesAttributeMatch

        public boolean doesAttributeMatch​(TranslationCache bb,
                                          Attribute attribute)
        Description copied from interface: AttributeRestriction
        Checks whether the given Attribute fulfills the restrictions imposed by this instance. The blackboard is used as cache.
        Specified by:
        doesAttributeMatch in interface AttributeRestriction
        Parameters:
        bb - The TranslatioCache to use for speeding up reoccuring lookups
        attribute - The attribute to check for a match
      • getPredicateForRestriction

        public String getPredicateForRestriction​(String attributeVariable)
        Description copied from interface: AttributeRestriction
        Return a prolog goal which represents this exact restriction in Prolog code. For example given the attributeVariable 'A' and teh restriction that this attribute needs to have the type 'mytype', the return code would be 'attributeDataType(A,'mytype')'.
        Specified by:
        getPredicateForRestriction in interface AttributeRestriction
        Parameters:
        attributeVariable - The Prolog variable which is used to match the restrictions
      • hashCode

        @Pure
        public int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        @Pure
        public boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • getRequiredContainingDataType

        @Pure
        public DataType getRequiredContainingDataType()