Use an iteration variable in walker
This commit is contained in:
parent
bfb7d9fa4c
commit
0122ee498c
1 changed files with 10 additions and 3 deletions
|
|
@ -927,6 +927,7 @@ class MetaInfo extends GISJsonSerialised {
|
|||
|
||||
class IterationInfo {
|
||||
private ArrayList<CollectedMeta> metacollection
|
||||
private Map<String, CollectedMeta>() metamap
|
||||
private String comment
|
||||
private int level
|
||||
private String gatheredpath
|
||||
|
|
@ -935,6 +936,7 @@ class MetaInfo extends GISJsonSerialised {
|
|||
private int maxdepth
|
||||
|
||||
IterationInfo(ArrayList<CollectedMeta> metacollection = new ArrayList<CollectedMeta>(),
|
||||
Map<String, CollectedMeta> metamap = new Map<String, CollectedMeta>(),
|
||||
String comment = '',
|
||||
int level = 0,
|
||||
String gatheredpath = '',
|
||||
|
|
@ -942,6 +944,7 @@ class MetaInfo extends GISJsonSerialised {
|
|||
boolean limiteddepth = false,
|
||||
int maxdepth = 0) {
|
||||
this.metacollection = metacollection
|
||||
this.metamap = metamap
|
||||
this.comment = comment
|
||||
this.level = level
|
||||
this.gatheredpath = gatheredpath
|
||||
|
|
@ -990,6 +993,7 @@ class MetaInfo extends GISJsonSerialised {
|
|||
def String nextgatheredpath = (ii.gatheredpath == '' ? relatedmetainfo.offsetpath : "${ii.gatheredpath}/${relatedmetainfo.offsetpath}")
|
||||
def String nextgatheredmetapath = (ii.gatheredmetapath == '' ? relatedmetainfo.offsetpath : "${ii.gatheredmetapath}/${relatedmetainfo.offsetpath}")
|
||||
def nextii = new IterationInfo(ii.metacollection,
|
||||
ii.metamap,
|
||||
ii.comment,
|
||||
ii.level + 1,
|
||||
nextgatheredpath,
|
||||
|
|
@ -1018,6 +1022,7 @@ class MetaInfo extends GISJsonSerialised {
|
|||
def childmetainfo = openchildmeta(ii, relatedmetainfo)
|
||||
if (childmetainfo.imported) {
|
||||
def nextii = new IterationInfo(ii.metacollection,
|
||||
ii.metamap,
|
||||
ii.comment,
|
||||
ii.level + 1,
|
||||
childmetainfo.nextgatheredpath,
|
||||
|
|
@ -1031,6 +1036,7 @@ class MetaInfo extends GISJsonSerialised {
|
|||
} else if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') {
|
||||
def MetaInfo othermeta = relatedmetainfo.meta
|
||||
def nextii = new IterationInfo(ii.metacollection,
|
||||
ii.metamap,
|
||||
ii.comment,
|
||||
ii.level + 1,
|
||||
ii.gatheredpath,
|
||||
|
|
@ -1046,12 +1052,13 @@ class MetaInfo extends GISJsonSerialised {
|
|||
return [ 'metacollection' : ii.metacollection, 'comment': ii.comment ]
|
||||
}
|
||||
|
||||
def allrelatedmeta(String metapath = '') {
|
||||
return walkrelated(new IterationInfo(metacollection, '', 0, '', metapath))
|
||||
def allrelatedmeta(String metapath = '') {,
|
||||
Map<String, CollectedMeta> metamap =
|
||||
return walkrelated(new IterationInfo(new ArrayList<CollectedMeta>(), new Map<String, CollectedMeta>(), '', 0, '', metapath))
|
||||
}
|
||||
|
||||
ArrayList<CollectedMeta> releasewalker(int maxdepth, String startpath = '', String startmetapath = '') {
|
||||
def results = walkrelated(new IterationInfo(metacollection, 'meta', 0, startpath, startmetapath, true, maxdepth))
|
||||
def results = walkrelated(new IterationInfo(new ArrayList<CollectedMeta>(), new Map<String, CollectedMeta>(), 'meta', 0, startpath, startmetapath, true, maxdepth))
|
||||
return results.metacollection
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue