public class BaseEntity extends Object
All entities must belong to a data set and contain a unique integer key. Class provides this functionality along with many common methods used by multiple entities.
All entities in this package extend this class. Every entity contains a unique integer key.
Objects of this class should not be created directly as they are part of the internal logic.
For more information see: 51Degrees pattern data model.
| Modifier and Type | Field and Description |
|---|---|
Dataset |
dataSet
The data set the item relates to.
|
int |
index
The unique index of the item in the collection of items, or the unique
offset to the item in the source data structure.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(BaseEntity other)
Compares entities based on their Index properties.
|
int |
compareTo(int offsetOrIndex)
The unique index of the item in the collection of items, or the unique
offset to the item in the source data structure.
|
protected Dataset |
getDataSet() |
int |
getIndex() |
static boolean |
getIsNumeric(byte value)
Determines if the value is an ASCII numeric value.
|
static int |
getNumber(byte[] array,
int start,
int length)
Returns an integer representation of the characters between start and
end.
|
protected static int[] |
readIntegerArray(BinaryReader reader,
int count)
Reads an integer array where the first integer is the number of following
integers.
|
protected static List<Integer> |
readIntegerList(BinaryReader reader,
int count)
Reads an integer list where the first integer is the number of following
integers.
|
public final Dataset dataSet
public final int index
public static boolean getIsNumeric(byte value)
value - Byte value to be checked.public int compareTo(int offsetOrIndex)
offsetOrIndex - The index of the item within the dataset.public int compareTo(BaseEntity other)
other - The entity to be compared against.protected static int[] readIntegerArray(BinaryReader reader, int count)
reader - Reader set to the position at the start of the listcount - The number of integers to read to form the arrayprotected static List<Integer> readIntegerList(BinaryReader reader, int count)
reader - Reader set to the position at the start of the listcount - The number of integers to read to form the arraypublic static int getNumber(byte[] array,
int start,
int length)
array - Array of characters with numeric characters present
between start and end.start - The first character to use to convert to a number.length - The number of characters to use in the conversion.protected Dataset getDataSet()
public int getIndex()
Copyright © 2017 51Degrees. All rights reserved.