public class CEConstraint extends Object implements Constraint
Modifier and Type | Class and Description |
---|---|
protected static class |
CEConstraint.Expand |
protected static class |
CEConstraint.FilterIterator |
protected static class |
CEConstraint.ReferenceIterator |
protected static class |
CEConstraint.Segment |
Modifier and Type | Field and Description |
---|---|
protected Map<DapNode,List<DapAttribute>> |
attributes |
protected List<DapDimension> |
dimrefs |
protected DapDataset |
dmr |
protected List<DapEnum> |
enums |
protected CEConstraint.Expand |
expansion |
protected boolean |
finished |
protected List<DapGroup> |
groups |
protected Map<DapDimension,DapDimension> |
redef |
protected Map<DapDimension,Slice> |
redefslice |
protected List<DapDimension> |
refdims |
protected List<CEConstraint.Segment> |
segments
"Map" of variables (at all levels) to be included
Maps variables -> associated slices
and is modified by computdimensions().
|
protected static Map<DapDataset,CEConstraint> |
universals |
protected List<DapVariable> |
variables
Also keep a raw list of variables
|
Constructor and Description |
---|
CEConstraint() |
CEConstraint(DapDataset dmr) |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(DapNode node,
DapAttribute attr) |
void |
addRedef(DapDimension dim,
Slice slice) |
void |
addVariable(DapVariable var,
List<Slice> slices) |
protected static int |
compare(Object lvalue,
Object rvalue) |
protected void |
computedimensions()
Compute dimension related information
using slicing and redef info.
|
protected void |
computeenums()
Walk all the included variables and accumulate
the referenced enums
|
protected void |
computegroups()
Walk all the included declarations
and accumulate the set of referenced groups
|
void |
contract()
Locate each Structure|Sequence and:
1.
|
protected boolean |
contractR(DapStructure dstruct,
Set<DapStructure> contracted)
Recursive helper
|
protected void |
dumpvar(CEConstraint.Segment seg,
StringBuilder buf,
boolean forconstraint)
Recursive helper for tostring/toConstraintString
|
protected Object |
eval(DapSequence seq,
DataRecord record,
CEAST expr)
Evaluate a filter with respect to a Sequence record.
|
void |
expand()
Locate each unexpanded Structure|Sequence and:
1.
|
protected int |
expansionCount(DapStructure struct)
Count the number of fields of a structure that
already in this view.
|
protected static Object |
fieldValue(DapSequence seq,
DataRecord record,
String field) |
CEConstraint.FilterIterator |
filterIterator(DapSequence dapseq,
DataSequence dataseq)
Selection X Iterator
Filter evaluation using an iterator.
|
protected CEConstraint.Segment |
findSegment(DapVariable var) |
protected int |
findVariableIndex(DapVariable var) |
CEConstraint |
finish()
Finish creating this Constraint.
|
List<DapDimension> |
getConstrainedDimensions(DapVariable var) |
List<Slice> |
getConstrainedSlices(DapVariable var) |
DapDataset |
getDMR() |
DapDimension |
getRedefDim(DapDimension orig) |
static CEConstraint |
getUniversal(DapDataset dmr) |
protected boolean |
isWholeCompound(DapStructure dstruct)
See if a structure is "whole", which
means that none of its fields is missing from the
constraint, all of fields use default (non-constrained)
dimension), and all of its fields are also whole.
|
boolean |
match(DapSequence seq,
DataRecord rec)
Selection X match
Evaluate a filter with respect to a Sequence record.
|
protected boolean |
matches(DapSequence seq,
DataRecord rec,
CEAST filter)
Evaluate a filter with respect to a Sequence record.
|
Odometer |
projectionIterator(DapVariable var)
Projection X Iterator
This basically returns an odometer that
will iterate over the appropriate values.
|
CEConstraint.ReferenceIterator |
referenceIterator()
Reference X Iterator
Iterate over the variables and return
those that are referenced.
|
boolean |
references(DapNode node)
Reference X match
|
static void |
release(DapDataset dmr) |
void |
setFilter(DapVariable var,
CEAST filter) |
String |
toConstraintString()
Convert the view to a constraint string suitable
for use in a URL, except not URL encoded.
|
String |
toString() |
protected static Map<DapDataset,CEConstraint> universals
protected DapDataset dmr
protected List<CEConstraint.Segment> segments
protected List<DapVariable> variables
protected Map<DapDimension,Slice> redefslice
protected Map<DapNode,List<DapAttribute>> attributes
protected Map<DapDimension,DapDimension> redef
protected List<DapDimension> dimrefs
protected List<DapDimension> refdims
protected boolean finished
protected CEConstraint.Expand expansion
public CEConstraint()
public CEConstraint(DapDataset dmr)
public static CEConstraint getUniversal(DapDataset dmr)
public static void release(DapDataset dmr)
protected static Object fieldValue(DapSequence seq, DataRecord record, String field) throws DapException
DapException
protected static int compare(Object lvalue, Object rvalue) throws DapException
DapException
protected Object eval(DapSequence seq, DataRecord record, CEAST expr) throws DapException
seq
- the templaterecord
- the record to evaluateexpr
- the filterDapException
public DapDataset getDMR()
public DapDimension getRedefDim(DapDimension orig)
public void addRedef(DapDimension dim, Slice slice)
public void addVariable(DapVariable var, List<Slice> slices) throws DapException
DapException
public void addAttribute(DapNode node, DapAttribute attr)
public void setFilter(DapVariable var, CEAST filter)
public List<Slice> getConstrainedSlices(DapVariable var)
public List<DapDimension> getConstrainedDimensions(DapVariable var)
public CEConstraint finish() throws DapException
DapException
public String toConstraintString()
protected void dumpvar(CEConstraint.Segment seg, StringBuilder buf, boolean forconstraint)
seg
- buf
- forconstraint
- public boolean references(DapNode node)
node
- to testpublic CEConstraint.ReferenceIterator referenceIterator() throws DapException
DapException
- if could not create.public Odometer projectionIterator(DapVariable var) throws DapException
var
- over whose dimensions to iterateDapException
public boolean match(DapSequence seq, DataRecord rec) throws DapException
seq
- the templaterec
- the record to evaluateDapException
protected boolean matches(DapSequence seq, DataRecord rec, CEAST filter) throws DapException
seq
- the templaterec
- the record to evaluatefilter
- the filterDapException
public CEConstraint.FilterIterator filterIterator(DapSequence dapseq, DataSequence dataseq) throws DapException
dapseq
- dataseq
- DapException
protected int findVariableIndex(DapVariable var)
protected CEConstraint.Segment findSegment(DapVariable var)
public void expand()
public void contract()
protected boolean contractR(DapStructure dstruct, Set<DapStructure> contracted)
dstruct
- to contractcontracted
- set of already contracted compoundsprotected int expansionCount(DapStructure struct)
struct
- the dapstructure to checkDapException
protected boolean isWholeCompound(DapStructure dstruct)
dstruct
- to testprotected void computedimensions() throws DapException
DapException
protected void computeenums()
protected void computegroups()
Copyright © 1999–2016 UCAR/Unidata. All rights reserved.