Package com.jk.core.jpa
Interface JKIndexable
- All Superinterfaces:
Comparable<JKIndexable>
- All Known Implementing Classes:
JKDefaultIndexable
This interface provides basic properties for an indexable entity.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Method Summary
Modifier and TypeMethodDescriptiondefault int
Compares this object with the specified object for order.int
getIndex()
This method gets the index of this indexable entity.getName()
This method gets the name of this indexable entity.JKListHolder<? extends JKIndexable>
This method gets the containerJKListHolder
that holds a list of objects implementing or extendingJKIndexable
.getUid()
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 containerJKListHolder
that holds a list of objects implementing or extendingJKIndexable
.void
This method sets the unique identifier (ID) of this indexable entity to the provided value.
-
Method Details
-
getParent
This method gets the containerJKListHolder
that holds a list of objects implementing or extendingJKIndexable
.- Returns:
- the parent container.
-
setParent
This method sets the containerJKListHolder
that holds a list of objects implementing or extendingJKIndexable
.- 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
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
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
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 allx
andy
. (This implies thatx.compareTo(y)
must throw an exception if and only ify.compareTo(x)
throws an exception.)The implementor must also ensure that the relation is transitive:
(x.compareTo(y) > 0 && y.compareTo(z) > 0)
impliesx.compareTo(z) > 0
.Finally, the implementor must ensure that
x.compareTo(y)==0
implies thatsignum(x.compareTo(z)) == signum(y.compareTo(z))
, for allz
.- Specified by:
compareTo
in interfaceComparable<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 nullClassCastException
- if the specified object's type prevents it from being compared to this object.
-