Interface JKIndexable

All Superinterfaces:
Comparable<JKIndexable>
All Known Implementing Classes:
JKDefaultIndexable

public interface JKIndexable extends Comparable<JKIndexable>
This interface provides basic properties for an indexable entity.
Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    Compares this object with the specified object for order.
    int
    This method gets the index of this indexable entity.
    This method gets the name of this indexable entity.
    This method gets the container JKListHolder that holds a list of objects implementing or extending JKIndexable.
    This method gets the unique identifier (ID) of this indexable entity.
    void
    setIndex(int index)
    This method sets the index of this indexable entity to the provided value.
    void
    This method sets the name of this indexable entity to the provided value.
    void
    setParent(JKListHolder<? extends JKIndexable> parent)
    This method sets the container JKListHolder that holds a list of objects implementing or extending JKIndexable.
    void
    setUid(String value)
    This method sets the unique identifier (ID) of this indexable entity to the provided value.
  • Method Details

    • getParent

      @BsonIgnore JKListHolder<? extends JKIndexable> getParent()
      This method gets the container JKListHolder that holds a list of objects implementing or extending JKIndexable.
      Returns:
      the parent container.
    • setParent

      void setParent(JKListHolder<? extends JKIndexable> parent)
      This method sets the container JKListHolder that holds a list of objects implementing or extending JKIndexable.
      Parameters:
      parent - Specifies the new parent container.
    • getUid

      String getUid()
      This method gets the unique identifier (ID) of this indexable entity.
      Returns:
      the unique identifier (ID) of this indexable entity.
    • setUid

      void setUid(String value)
      This method sets the unique identifier (ID) of this indexable entity to the provided value.
      Parameters:
      value - Specifies the new unique identifier (ID) of this indexable entity.
    • setName

      void setName(String name)
      This method sets the name of this indexable entity to the provided value.
      Parameters:
      name - Specifies the new name of this indexable entity.
    • getName

      String getName()
      This method gets the name of this indexable entity.
      Returns:
      the name of this indexable entity.
    • setIndex

      void setIndex(int index)
      This method sets the index of this indexable entity to the provided value.
      Parameters:
      index - Specifies the new index of this indexable entity.the
    • getIndex

      int getIndex()
      This method gets the index of this indexable entity.
      Returns:
      the index of this indexable entity.
    • compareTo

      default int compareTo(JKIndexable o)
      Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

      The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

      The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

      Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

      Specified by:
      compareTo in interface Comparable<JKIndexable>
      Parameters:
      o - the object to be compared.
      Returns:
      a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
      Throws:
      NullPointerException - if the specified object is null
      ClassCastException - if the specified object's type prevents it from being compared to this object.