public class CodeMetadataStorage extends java.lang.Object implements ICodeMetadata
EMPTY| Modifier and Type | Method and Description |
|---|---|
static ICodeMetadata |
build(java.util.Map<java.lang.Integer,java.lang.Integer> lines,
java.util.Map<java.lang.Integer,ICodeAnnotation> map) |
static ICodeMetadata |
empty() |
java.util.NavigableMap<java.lang.Integer,ICodeAnnotation> |
getAsMap() |
ICodeAnnotation |
getAt(int position) |
@Nullable ICodeAnnotation |
getClosestUp(int position) |
java.util.Map<java.lang.Integer,java.lang.Integer> |
getLineMapping() |
ICodeNodeRef |
getNodeAt(int position)
Get current node at position (can be enclosing class or method)
|
ICodeNodeRef |
getNodeBelow(int position)
Any definition of class or method below position
|
<T> T |
searchDown(int startPos,
java.util.function.BiFunction<java.lang.Integer,ICodeAnnotation,T> visitor)
Iterate code annotations from
startPos to higher positions. |
<T> T |
searchUp(int startPos,
java.util.function.BiFunction<java.lang.Integer,ICodeAnnotation,T> visitor)
Iterate code annotations from
startPos to smaller positions. |
@Nullable ICodeAnnotation |
searchUp(int position,
ICodeAnnotation.AnnType annType) |
@Nullable ICodeAnnotation |
searchUp(int position,
int limitPos,
ICodeAnnotation.AnnType annType) |
java.lang.String |
toString() |
public static ICodeMetadata build(java.util.Map<java.lang.Integer,java.lang.Integer> lines, java.util.Map<java.lang.Integer,ICodeAnnotation> map)
public static ICodeMetadata empty()
public ICodeAnnotation getAt(int position)
getAt in interface ICodeMetadata@Nullable public @Nullable ICodeAnnotation getClosestUp(int position)
getClosestUp in interface ICodeMetadata@Nullable public @Nullable ICodeAnnotation searchUp(int position, ICodeAnnotation.AnnType annType)
searchUp in interface ICodeMetadata@Nullable public @Nullable ICodeAnnotation searchUp(int position, int limitPos, ICodeAnnotation.AnnType annType)
searchUp in interface ICodeMetadata@Nullable
public <T> T searchUp(int startPos,
java.util.function.BiFunction<java.lang.Integer,ICodeAnnotation,T> visitor)
ICodeMetadatastartPos to smaller positions.searchUp in interface ICodeMetadatavisitor - return not null value to stop iterations@Nullable
public <T> T searchDown(int startPos,
java.util.function.BiFunction<java.lang.Integer,ICodeAnnotation,T> visitor)
ICodeMetadatastartPos to higher positions.searchDown in interface ICodeMetadatavisitor - return not null value to stop iterationspublic ICodeNodeRef getNodeAt(int position)
ICodeMetadatagetNodeAt in interface ICodeMetadatapublic ICodeNodeRef getNodeBelow(int position)
ICodeMetadatagetNodeBelow in interface ICodeMetadatapublic java.util.NavigableMap<java.lang.Integer,ICodeAnnotation> getAsMap()
getAsMap in interface ICodeMetadatapublic java.util.Map<java.lang.Integer,java.lang.Integer> getLineMapping()
getLineMapping in interface ICodeMetadatapublic java.lang.String toString()
toString in class java.lang.Object