Package com.basis.filesystem.util
Class KeySegment
java.lang.Object
com.basis.filesystem.util.KeySegment
- All Implemented Interfaces:
Serializable
Class used to describe individual key segments of derived keys in MKEYED and
XKEYED files.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionKeySegment(int p_fieldNumber, int p_offset, int p_length, boolean p_descending, boolean p_bus) Deprecated.KeySegment(int p_fieldNumber, int p_offset, int p_length, boolean p_descending, int p_special) Constructor -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected final voidfixDescendingSegment(io.netty.buffer.ByteBuf p_fromKey, io.netty.buffer.ByteBuf p_toKey, Locale p_locale, Charset p_charset, boolean p_mangle) Fix descending segment so that it is switched to/from normal.protected final voidgetAndFixSegmentForRecord(String p_filename, io.netty.buffer.ByteBuf p_record, int p_actualRecordSize, io.netty.buffer.ByteBuf p_key, boolean p_checkFields, Locale p_locale, Charset p_charset, boolean p_mangle) Both get and fix a key segment for a record.intgetField()Get field.intGet length.intGet offset.protected final intgetSegmentForRecord(String p_filename, io.netty.buffer.ByteBuf p_record, int p_actualRecordSize, io.netty.buffer.ByteBuf p_key, boolean p_checkFields, Charset p_charset) Get segment from a record.intGet special type.inthashCode()booleanisBUS()Get bus.booleanGet case insensitive.booleanGet descending.booleanisNormal()Is this segment normal.booleanDeprecated.booleanGet ordered numeric.toString()
-
Field Details
-
SEGMENT_NORMAL
public static final int SEGMENT_NORMAL- See Also:
-
SEGMENT_BUS
public static final int SEGMENT_BUS- See Also:
-
SEGMENT_ORDERED_NUMERIC
public static final int SEGMENT_ORDERED_NUMERIC- See Also:
-
SEGMENT_CASE_INSENSITIVE
public static final int SEGMENT_CASE_INSENSITIVE- See Also:
-
-
Constructor Details
-
KeySegment
public KeySegment() -
KeySegment
@Deprecated public KeySegment(int p_fieldNumber, int p_offset, int p_length, boolean p_descending, boolean p_bus) throws FilesystemException Deprecated.Constructor- Parameters:
p_fieldNumber- Number of field to start segment on -- start at beginning of record if 0.p_offset- Offset within field to start at.p_length- How many bytes the segment consists of.p_descending- If true then segment is descending.p_bus- If true the segment is an 8 byte business math value.- Throws:
FilesystemException- If a filesystem problem occurs.
-
KeySegment
public KeySegment(int p_fieldNumber, int p_offset, int p_length, boolean p_descending, int p_special) throws FilesystemException Constructor- Parameters:
p_fieldNumber- Number of field to start segment on -- start at beginning of record if 0.p_offset- Offset within field to start at.p_length- How many bytes the segment consists of.p_descending- If true then segment is descending.p_special- Special segment type.- Throws:
FilesystemException- If a filesystem problem occurs.
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
getSpecialType
public int getSpecialType()Get special type.- Returns:
- Special type.
-
getField
public int getField()Get field.- Returns:
- Field number.
-
getOffset
public int getOffset()Get offset.- Returns:
- Offset.
-
getLength
public int getLength()Get length.- Returns:
- Length.
-
isDescending
public boolean isDescending()Get descending.- Returns:
- true if segment is descending.
-
isBUS
public boolean isBUS()Get bus.- Returns:
- true if segment is numeric.
-
isNumeric
Deprecated.Get bus. Deprecated method.- Returns:
- true if segment is numeric.
-
isOrderedNumeric
public boolean isOrderedNumeric()Get ordered numeric.- Returns:
- true if segment is ordered numeric.
-
isCaseInsensitive
public boolean isCaseInsensitive()Get case insensitive.- Returns:
- true if segment is ordered numeric.
-
isNormal
public boolean isNormal()Is this segment normal.- Returns:
- true if segment is normal.
-
getSegmentForRecord
protected final int getSegmentForRecord(String p_filename, io.netty.buffer.ByteBuf p_record, int p_actualRecordSize, io.netty.buffer.ByteBuf p_key, boolean p_checkFields, Charset p_charset) throws FilesystemException Get segment from a record.- Parameters:
p_filename-p_record- Record to get segment from.p_key- Buffer to put segment in.p_checkFields- Should field existence be enforced?p_charset- Charset for encode/decode strings.- Throws:
FilesystemException
-
getAndFixSegmentForRecord
protected final void getAndFixSegmentForRecord(String p_filename, io.netty.buffer.ByteBuf p_record, int p_actualRecordSize, io.netty.buffer.ByteBuf p_key, boolean p_checkFields, Locale p_locale, Charset p_charset, boolean p_mangle) throws FilesystemException Both get and fix a key segment for a record.- Parameters:
p_filename-p_record-p_actualRecordSize-p_key-p_checkFields-p_locale-p_charset-p_mangle-- Throws:
FilesystemException
-
fixDescendingSegment
protected final void fixDescendingSegment(io.netty.buffer.ByteBuf p_fromKey, io.netty.buffer.ByteBuf p_toKey, Locale p_locale, Charset p_charset, boolean p_mangle) Fix descending segment so that it is switched to/from normal.- Parameters:
p_fromKey- Key to convert.p_toKey- Key buffer to fill.p_locale- Locale for case insensitive.p_charset- Charset for decoding/encoding strings.p_mangle- true if numeric fields should be adjusted for descending.
-
toString
-