Package eu.bandm.tools.message
Class Location.Set<D>
java.lang.Object
eu.bandm.tools.message.Location<D>
eu.bandm.tools.message.Location.Set<D>
- All Implemented Interfaces:
Locatable<D>
,Serializable
,Cloneable
The third sub-class, representing regions with gaps, or even in
different documents.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.bandm.tools.message.Location
Location.NumberMode, Location.Set<D>
-
Field Summary
Fields inherited from class eu.bandm.tools.message.Location
eq, formatEmacs, MAX_PARTICULAR, MIN_PARTICULAR, NOT_APPLICABLE, UNKNOWN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Defined for Regions covering only one line: Delivers the relative offset (in column numbers) of the given position from the start of the region.boolean
Whether the argument is contained in this Location.int
The number of spanned characters, if the LocationLocation.isContiguous()
Returns the begin point of this location.Returns the end point of this location.Returns the reference point of this location.Returns every kind of Location as a collection of Point and Region instances.boolean
Whether this describes a set of characters in the same line.boolean
isPoint()
Checks whether this location is a point.boolean
isRegion()
Checks whether this location is an Region.<E> Location<E>
mapDocumentId
(Function<? super D, ? extends E> f) rel2abs
(int off) Defined for Regions covering only one line: Delivers a point in the Region which has the given offset from the start of the region.Methods inherited from class eu.bandm.tools.message.Location
cast, clone, comparable, comparable, equals, formatEmacs, getBeginColumn, getBeginLine, getColumn, getDocumentId, getEndColumn, getEndLine, getLine, getLocation, getMode, hashCode, isAdjacent, isApplicable, isColumnDeficient, isDeficient, isLineDeficient, isParticular, isPointOrRegion, isRegionInOneLine, isSet, isSpecified, isValid, liftMapDocumentId, line, line_from_to, live, live, mapDocumentId, max, min, nextLine, noLocation, offset, point, pointOrder, referencePointOrder, region, region, regionRobust, regionRobustUnchecked, regionSorted, setOf, subsequentChars, toString
-
Constructor Details
-
Set
Set(Collection<? extends Location<D>> regions) Construcor, not callable. The constructin goes viy the factors methods inLocation
-
-
Method Details
-
mapDocumentId
- Specified by:
mapDocumentId
in classLocation<D>
- Returns:
- a new location, by applying "f" to the document id/ids therein.
-
isPoint
public boolean isPoint()Description copied from class:Location
Checks whether this location is a point. If this method returnstrue
, then the reference point, begin point and end point of this location are all equal to this location. -
isRegion
public boolean isRegion()Description copied from class:Location
Checks whether this location is an Region. If this method returnstrue
, then the region partition (as returned byLocation.getRegions()
) of this location contains a single location equal to this location. -
getReferencePoint
Description copied from class:Location
Returns the reference point of this location. The reference point is a point. If this location is a point, then the reference point is equal to this location. If this location is an region, then the reference point lies within this location. If this location is a set, then the reference point lies within one of the member regions.- Specified by:
getReferencePoint
in classLocation<D>
- Returns:
- the reference point of this location.
-
getBeginPoint
Description copied from class:Location
Returns the begin point of this location. The begin point is a point. If this location is a point, then the begin point is equal to this location. If this location is an region, then the begin point lies at the beginning of this location. If this location is a set, then the begin point lies at the beginning of one of the member regions, such that there is no member region that lies in the same document and begins before the begin point.- Specified by:
getBeginPoint
in classLocation<D>
- Returns:
- the begin point of this location.
-
getEndPoint
Description copied from class:Location
Returns the end point of this location. The end point is a point. If this location is a point, then the end point is equal to this location. If this location is an region, then the end point lies at the end of this location. If this location is a set, then the end point lies at the end of one of the member regions, such that there is no member region that lies in the same document and ends after the end point.- Specified by:
getEndPoint
in classLocation<D>
- Returns:
- the end point of this location.
-
getRegions
Description copied from class:Location
Returns every kind of Location as a collection of Point and Region instances. If this is a Point or Region, than only this is contained in that collection.- Specified by:
getRegions
in classLocation<D>
-
contains
Description copied from class:Location
Whether the argument is contained in this Location. If this is a point, then this and loc must be identical. Otherwise for every Region or Point in loc there must be an Region or Point in this which completelycontains it. -
isContiguous
public boolean isContiguous()Description copied from class:Location
Whether this describes a set of characters in the same line. This is the case for every Point and possibly for an Region, but never for a Set.- Specified by:
isContiguous
in classLocation<D>
-
contiguousSize
public int contiguousSize()Description copied from class:Location
The number of spanned characters, if the LocationLocation.isContiguous()
- Specified by:
contiguousSize
in classLocation<D>
-
abs2rel
Description copied from class:Location
Defined for Regions covering only one line: Delivers the relative offset (in column numbers) of the given position from the start of the region. And defined for two identic Points yielding 0. -
rel2abs
Description copied from class:Location
Defined for Regions covering only one line: Delivers a point in the Region which has the given offset from the start of the region. And defined for a point and offset==0, yielding this point.
-