Class IndexEntry

  • All Implemented Interfaces:
    java.io.Serializable

    @ThreadSafe
    public class IndexEntry
    extends java.lang.Object
    implements java.io.Serializable
    A CPE entry containing the name, vendor, product, and version.
    Author:
    Jeremy Long
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      IndexEntry()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      int getDocumentId()
      Get the value of documentId.
      java.lang.String getProduct()
      Get the value of product.
      float getSearchScore()
      Get the value of searchScore.
      java.lang.String getVendor()
      Get the value of vendor.
      int hashCode()  
      void parseName​(java.lang.String cpeName)
      Parses a name attribute value, from the cpe.xml, into its corresponding parts: vendor, product.
      void setDocumentId​(int documentId)
      Set the value of documentId.
      void setProduct​(java.lang.String product)
      Set the value of product.
      void setSearchScore​(float searchScore)
      Set the value of searchScore.
      void setVendor​(java.lang.String vendor)
      Set the value of vendor.
      java.lang.String toString()
      Standard implementation of toString showing vendor and product.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • IndexEntry

        public IndexEntry()
    • Method Detail

      • getDocumentId

        public int getDocumentId()
        Get the value of documentId.
        Returns:
        the value of documentId
      • setDocumentId

        public void setDocumentId​(int documentId)
        Set the value of documentId.
        Parameters:
        documentId - new value of documentId
      • getVendor

        public java.lang.String getVendor()
        Get the value of vendor.
        Returns:
        the value of vendor
      • setVendor

        public void setVendor​(java.lang.String vendor)
        Set the value of vendor.
        Parameters:
        vendor - new value of vendor
      • getProduct

        public java.lang.String getProduct()
        Get the value of product.
        Returns:
        the value of product
      • setProduct

        public void setProduct​(java.lang.String product)
        Set the value of product.
        Parameters:
        product - new value of product
      • getSearchScore

        public float getSearchScore()
        Get the value of searchScore.
        Returns:
        the value of searchScore
      • setSearchScore

        public void setSearchScore​(float searchScore)
        Set the value of searchScore.
        Parameters:
        searchScore - new value of searchScore
      • parseName

        public void parseName​(java.lang.String cpeName)
                       throws java.io.UnsupportedEncodingException

        Parses a name attribute value, from the cpe.xml, into its corresponding parts: vendor, product.

        Example:

        nbsp;nbsp;nbsp;cpe:/a:apache:struts:1.1:rc2

        Results in:

        • Vendor: apache
        • Product: struts

        If it is necessary to parse the CPE into more parts (i.e. to include version and revision) then you should use the `cpe-parser`.

        Parameters:
        cpeName - the CPE name
        Throws:
        java.io.UnsupportedEncodingException - should never be thrown...
      • hashCode

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Standard implementation of toString showing vendor and product.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representation of the object