Class Completion


  • public class Completion
    extends java.lang.Object
    A class representing a possible completion of an incomplete order.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_PRIORITY
      Field DEFAULT_PRIORITY The default priority value, lower priority comes first
    • Constructor Summary

      Constructors 
      Constructor Description
      Completion​(java.lang.String text)
      Creates a new Completion object.
      Completion​(java.lang.String text, int prio)
      Creates a new Completion object.
      Completion​(java.lang.String text, java.lang.String postfix)
      Creates a new Completion object.
      Completion​(java.lang.String text, java.lang.String postfix, int prio)
      Creates a new Completion object.
      Completion​(java.lang.String text, java.lang.String postfix, int prio, int cursorOffset)
      Creates a new Completion object.
      Completion​(java.lang.String name, java.lang.String value, java.lang.String postfix)
      Creates a new Completion object.
      Completion​(java.lang.String name, java.lang.String value, java.lang.String postfix, int prio)
      Creates a new Completion object.
      Completion​(java.lang.String name, java.lang.String value, java.lang.String postfix, int prio, int cursorOffset)
      Creates a new Completion object.
      Completion​(Completion c)
      Creates a new Completion object as shallow copy of another one.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      int getCursorOffset()
      Returns the value the cursor should be set back after insertion.
      java.lang.String getName()
      Returns the text that should be displayed to the user.
      java.lang.String getPostfix()
      Returns the text that should be inserted after the value.
      int getPriority()
      Returns the sorting priority (lower priority comes first).
      java.lang.String getValue()
      Returns the value that is inserted if this completion is chosen including postfix.
      int hashCode()  
      java.lang.String replace​(java.lang.String line, java.lang.String stub)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • DEFAULT_PRIORITY

        public static final int DEFAULT_PRIORITY
        Field DEFAULT_PRIORITY The default priority value, lower priority comes first
        See Also:
        Constant Field Values
    • Constructor Detail

      • Completion

        public Completion​(java.lang.String text)
        Creates a new Completion object.
        Parameters:
        text - The name that is to be displayed to the user and inserted as value
      • Completion

        public Completion​(java.lang.String text,
                          int prio)
        Creates a new Completion object.
        Parameters:
        text - The name that is to be displayed to the user and inserted as value
        prio - The sorting priority, lower priority comes first
      • Completion

        public Completion​(java.lang.String name,
                          java.lang.String value,
                          java.lang.String postfix)
        Creates a new Completion object.
        Parameters:
        name - The name that is to be displayed to the user
        value - The value that is inserted if this completion is chosen
        postfix - This is what should be inserted after the value but should not influence, for example, sorting
      • Completion

        public Completion​(java.lang.String text,
                          java.lang.String postfix)
        Creates a new Completion object.
        Parameters:
        text - The name that is to be displayed to the user and inserted as value
        postfix - This is what should be inserted after the value but should not influence, for example, sorting
      • Completion

        public Completion​(java.lang.String text,
                          java.lang.String postfix,
                          int prio)
        Creates a new Completion object.
        Parameters:
        text - The name that is to be displayed to the user and inserted as value
        postfix - This is what should be inserted after the value but should not influence, for example, sorting
        prio - The sorting priority, lower priority comes first
      • Completion

        public Completion​(java.lang.String name,
                          java.lang.String value,
                          java.lang.String postfix,
                          int prio)
        Creates a new Completion object.
        Parameters:
        name - The name that is to be displayed to the user
        value - The value that is inserted if this completion is chosen
        postfix - This is what should be inserted after the value but should not influence, for example, sorting
        prio - The sorting priority, lower priority comes first
      • Completion

        public Completion​(java.lang.String text,
                          java.lang.String postfix,
                          int prio,
                          int cursorOffset)
        Creates a new Completion object.
        Parameters:
        text - The name that is to be displayed to the user and inserted as value
        postfix - This is what should be inserted after the value but should not influence, for example, sorting
        prio - The sorting priority, lower priority comes first
        cursorOffset - Indicates that the cursor is set back this amount of characters
      • Completion

        public Completion​(java.lang.String name,
                          java.lang.String value,
                          java.lang.String postfix,
                          int prio,
                          int cursorOffset)
        Creates a new Completion object.
        Parameters:
        name - The name that is to be displayed to the user
        value - The value that is inserted if this completion is chosen
        postfix - This is what should be inserted after the value but should not influence, for example, sorting
        prio - The sorting priority, lower priority comes first
        cursorOffset - Indicates that the cursor is set back this amount of characters
      • Completion

        public Completion​(Completion c)
        Creates a new Completion object as shallow copy of another one.
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the text that should be displayed to the user.
      • getValue

        public java.lang.String getValue()
        Returns the value that is inserted if this completion is chosen including postfix.
      • getPriority

        public int getPriority()
        Returns the sorting priority (lower priority comes first).
      • getPostfix

        public java.lang.String getPostfix()
        Returns the text that should be inserted after the value.
      • getCursorOffset

        public int getCursorOffset()
        Returns the value the cursor should be set back after insertion.
      • equals

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

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()
      • replace

        public java.lang.String replace​(java.lang.String line,
                                        java.lang.String stub)