@Runtime public class LocationMap<D,E> extends Object
Location
s, when re-arranging of text fragments
has been performed, and location info must be adjusted accordingly.
Location
). They must be entered pairwise, with identical lengths.Modifier and Type | Class and Description |
---|---|
class |
LocationMap.Translator
A message receiver which passes on all messages after translating the
location according to the mapping represented by its outer class.
|
Modifier and Type | Field and Description |
---|---|
protected List<Location<D>> |
leftlocs |
Function<Location<D>,Location<E>> |
mapLocations |
Function<SimpleMessage<D>,SimpleMessage<E>> |
mapMessages
A public
Function object which applies the mapping of the
containing class to the location fields of SimpleMessage s. |
protected List<Location<E>> |
rightlocs |
protected boolean |
transparent |
Constructor and Description |
---|
LocationMap() |
Modifier and Type | Method and Description |
---|---|
protected <P,Q> Location<Q> |
doResolve(List<Location<P>> from,
List<Location<Q>> to,
Location<P> loc) |
void |
dump(PrintStream p) |
void |
put(Location<D> left,
Location<E> right)
establishes the mapping between both locations.
|
Location<D> |
resolve_backward(Location<E> loc)
Performs the mapping from right to left,
Can currently only deal with points and intervals, not with sets.
|
Location<E> |
resolve(Location<D> loc)
Performs the mapping from left to right,
Can currently only deal with points and intervals, not with sets.
|
protected static <P,Q> Location<Q> |
resolvePoint(List<Location<P>> from,
List<Location<Q>> to,
Location<P> loc) |
boolean |
setTransparent(boolean trans)
Sets the transparent attribute and returns its old value.
|
protected boolean transparent
public final Function<SimpleMessage<D>,SimpleMessage<E>> mapMessages
Function
object which applies the mapping of the
containing class to the location fields of SimpleMessage
s.public void put(Location<D> left, Location<E> right)
left
and right
must be of "region" type and must have
equal length.public boolean setTransparent(boolean trans)
public Location<E> resolve(Location<D> loc)
public Location<D> resolve_backward(Location<E> loc)
protected <P,Q> Location<Q> doResolve(List<Location<P>> from, List<Location<Q>> to, Location<P> loc)
protected static <P,Q> Location<Q> resolvePoint(List<Location<P>> from, List<Location<Q>> to, Location<P> loc)
public void dump(PrintStream p)
see also the complete user documentation .