Class TextSearchModelMatch

java.lang.Object
com._1c.g5.v8.dt.search.core.Match
com._1c.g5.v8.dt.search.core.text.TextSearchModelMatch
All Implemented Interfaces:
IMatchParentProvider, Comparable<TextSearchModelMatch>

public class TextSearchModelMatch extends Match implements Comparable<TextSearchModelMatch>
Representation of finded text in model by text search
  • Constructor Details

    • TextSearchModelMatch

      public TextSearchModelMatch(IBmModel model, String text, long topObjectId, long objectId, org.eclipse.emf.ecore.EStructuralFeature feature, int textOffset, int textLength)
      Create instance of text search file match
      Parameters:
      model - the BM model contain matched object, cannot be null
      text - the property value contains the search text, cannot be null
      topObjectId - the file containing the search text, cannot be null
      objectId - the match object ID
      feature - the reference contains the search text, cannot be null
      textOffset - the offset index of finded text in property value
      textLength - the length of finded text
  • Method Details

    • getObjectId

      public long getObjectId()
      Get the object ID
      Returns:
      the matched object ID
    • getFeature

      public org.eclipse.emf.ecore.EStructuralFeature getFeature()
      The feature reference contains the search text
      Returns:
      the feature
    • getTopObjectId

      public long getTopObjectId()
      Returns bmId of container top object of property with finded text
      Returns:
      the container top object bmId
    • resolveMatchObject

      public Optional<IBmObject> resolveMatchObject()
      Resolve match contains object
      Returns:
      match contains object, or empty optional if engine of BM model is disposed or not in 'running' state
    • resolveMatchTopObject

      public Optional<IBmObject> resolveMatchTopObject()
      Resolve top object for match contains object
      Returns:
      top object, or empty optional if engine of BM model is disposed or not in 'running' state
    • getText

      public String getText()
      Returns property value text contains search text
      Returns:
      the property value text, never null
    • getTextLength

      public int getTextLength()
      Returns the length of finded text
      Returns:
      the finded text length
    • getTextOffset

      public int getTextOffset()
      Returns offset index of finded text in property value
      Returns:
      the text offset index
    • getElement

      public Object getElement()
      Description copied from class: Match
      Returns the element that contains this match. The element is used to group the match.
      Specified by:
      getElement in class Match
      Returns:
      the element that contains this match, cannot be null
    • compareTo

      public int compareTo(TextSearchModelMatch other)
      Specified by:
      compareTo in interface Comparable<TextSearchModelMatch>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Match
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Match