Package com.e1c.langtool.collector
Class SegmentFeatureKey
java.lang.Object
com.e1c.langtool.collector.SegmentFeatureKey
- All Implemented Interfaces:
FeatureKey,Serializable,Comparable<FeatureKey>
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappend(FeatureKey relativeFeatureKey) Append.Append.intcompareTo(FeatureKey key) protected intcompareTo(FeatureKey key, boolean ignoreCase) intCompare toFeatureKeywith ignore case of segments.static SegmentFeatureKeyLow-level factory method.static SegmentFeatureKeyLow-level factory method.static SegmentFeatureKeyLow-level factory method.booleanGets the first segment.getId()Gets the id representing default serializing of the object to string.Gets the last segment.getSegment(int index) Gets the segment.intGets the segment count.Gets the segments.inthashCode()booleanisEmpty()Checks if the key is empty, means that segments are empty.skipFirst(int skipCount) Skip first.skipLast(int skipCount) Skip last segmentsbooleanstartsWith(FeatureKey prefix) Starts with.protected booleanstartsWith(FeatureKey prefix, boolean ignoreCase) booleanstartsWithIgnoreCase(FeatureKey prefix) Starts with ignore case.To lower case.toString()Returns a canonical String representation of this using '.' as namespace delimiter.Returns a String representation of this usingdelimiteras namespace delimiter.To upper case.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
SegmentFeatureKey
-
-
Method Details
-
create
Low-level factory method.- Parameters:
singleSegment- the single segment of the newly created feature key- Throws:
IllegalArgumentException- if the singleSegment is null
-
create
Low-level factory method.- Parameters:
segments- the segments of the to-be-created feature key. May benull, but may not containnullentries.- Returns:
- a
FeatureKey. Nevernull. - Throws:
IllegalArgumentException- if any of the segments is null
-
create
Low-level factory method.- Parameters:
segments- the segments of the to-be-created feature key. May benull, but may not containnullentries.- Returns:
- a
FeatureKey. Nevernull. - Throws:
IllegalArgumentException- if any of the segments is null
-
compareTo
- Specified by:
compareToin interfaceComparable<FeatureKey>
-
compareToIgnoreCase
Description copied from interface:FeatureKeyCompare toFeatureKeywith ignore case of segments.- Specified by:
compareToIgnoreCasein interfaceFeatureKey- Parameters:
key- the key to compare- Returns:
- the result
-
compareTo
-
getId
Description copied from interface:FeatureKeyGets the id representing default serializing of the object to string.- Specified by:
getIdin interfaceFeatureKey- Returns:
- the id
-
getSegments
Description copied from interface:FeatureKeyGets the segments.- Specified by:
getSegmentsin interfaceFeatureKey- Returns:
- the segments
-
isEmpty
public boolean isEmpty()Description copied from interface:FeatureKeyChecks if the key is empty, means that segments are empty.- Specified by:
isEmptyin interfaceFeatureKey- Returns:
- true, if is empty
-
getSegmentCount
public int getSegmentCount()Description copied from interface:FeatureKeyGets the segment count.- Specified by:
getSegmentCountin interfaceFeatureKey- Returns:
- the segment count
-
getSegment
Description copied from interface:FeatureKeyGets the segment.- Specified by:
getSegmentin interfaceFeatureKey- Parameters:
index- the index- Returns:
- the segment
-
getLastSegment
Description copied from interface:FeatureKeyGets the last segment.- Specified by:
getLastSegmentin interfaceFeatureKey- Returns:
- the last segment
-
getFirstSegment
Description copied from interface:FeatureKeyGets the first segment.- Specified by:
getFirstSegmentin interfaceFeatureKey- Returns:
- the first segment
-
append
Description copied from interface:FeatureKeyAppend.- Specified by:
appendin interfaceFeatureKey- Parameters:
segment- the segment- Returns:
- the new feature key
-
append
Description copied from interface:FeatureKeyAppend.- Specified by:
appendin interfaceFeatureKey- Parameters:
relativeFeatureKey- the relative feature key- Returns:
- the new feature key
-
skipFirst
Description copied from interface:FeatureKeySkip first.- Specified by:
skipFirstin interfaceFeatureKey- Parameters:
skipCount- the skip count- Returns:
- the new feature key
-
skipLast
Description copied from interface:FeatureKeySkip last segments- Specified by:
skipLastin interfaceFeatureKey- Parameters:
skipCount- the skip count- Returns:
- the new feature key
-
startsWith
Description copied from interface:FeatureKeyStarts with.- Specified by:
startsWithin interfaceFeatureKey- Parameters:
prefix- the prefix- Returns:
- true, if successful
-
startsWithIgnoreCase
Description copied from interface:FeatureKeyStarts with ignore case.- Specified by:
startsWithIgnoreCasein interfaceFeatureKey- Parameters:
prefix- the prefix- Returns:
- true, if successful
-
toLowerCase
Description copied from interface:FeatureKeyTo lower case.- Specified by:
toLowerCasein interfaceFeatureKey- Returns:
- the new feature key
-
toUpperCase
Description copied from interface:FeatureKeyTo upper case.- Specified by:
toUpperCasein interfaceFeatureKey- Returns:
- the new feature key
-
startsWith
-
hashCode
public int hashCode() -
equals
-
toString
Returns a canonical String representation of this using '.' as namespace delimiter. -
toString
Returns a String representation of this usingdelimiteras namespace delimiter.- Parameters:
delimiter- the delimiter to use.nullwill be represented as the String "null".- Returns:
- the concatenated segments joined with the given
delimiter
-