Class SimpleRichFeatureRelationship

    • Constructor Detail

      • SimpleRichFeatureRelationship

        public SimpleRichFeatureRelationship​(RichFeature object,
                                             RichFeature subject,
                                             ComparableTerm term,
                                             int rank)
        Creates a new instance of SimpleRichFeatureRelationship.
        Parameters:
        subject - The subject RichFeature.
        term - The relationship term.
        rank - the rank of the relationship.
      • SimpleRichFeatureRelationship

        protected SimpleRichFeatureRelationship()
    • Method Detail

      • getContainsTerm

        public static ComparableTerm getContainsTerm()
        Gets the default CONTAINS term used for defining the relationship between features.
        Returns:
        the default CONTAINS term.
      • getRank

        public int getRank()
        Gets the rank of this relationship.
        Specified by:
        getRank in interface RichFeatureRelationship
        Returns:
        Value of property rank.
      • getObject

        public RichFeature getObject()
        Returns the object of this relationship (ie. the feature which this relationship starts from). This is an immutable property set by the constructor of an instantiating class.
        Specified by:
        getObject in interface RichFeatureRelationship
        Returns:
        Value of property object.
      • getSubject

        public RichFeature getSubject()
        Gets the feature that this relationship refers to. This is set at constructor time and is immutable.
        Specified by:
        getSubject in interface RichFeatureRelationship
        Returns:
        Value of property subject.
      • getTerm

        public ComparableTerm getTerm()
        Gets the term that describes this relationship. This is set at constructor time and is immutable.
        Specified by:
        getTerm in interface RichFeatureRelationship
        Returns:
        Value of property term.
      • compareTo

        public int compareTo​(java.lang.Object o)
        Relations are compared first by rank, then object, subject, then finally term.
        Specified by:
        compareTo in interface java.lang.Comparable
      • equals

        public boolean equals​(java.lang.Object obj)
        Relations are equal if their objects, subjects and terms are equal.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Form: "(#rank) term(object,subject)"
        Overrides:
        toString in class java.lang.Object
      • getId

        public java.lang.Integer getId()
        Gets the Hibernate ID. Should be used with caution.
        Returns:
        the Hibernate ID, if using Hibernate.
      • setId

        public void setId​(java.lang.Integer id)
        Sets the Hibernate ID. Should be used with caution.
        Parameters:
        id - the Hibernate ID, if using Hibernate.