public class CEConstraint
extends java.lang.Object
implements dap4.core.data.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 java.util.Map<dap4.core.dmr.DapNode,java.util.List<dap4.core.dmr.DapAttribute>> |
attributes |
protected java.util.List<dap4.core.dmr.DapDimension> |
dimrefs |
protected dap4.core.dmr.DapDataset |
dmr |
protected java.util.List<dap4.core.dmr.DapEnum> |
enums |
protected CEConstraint.Expand |
expansion |
protected boolean |
finished |
protected java.util.List<dap4.core.dmr.DapGroup> |
groups |
protected java.util.Map<dap4.core.dmr.DapDimension,dap4.core.dmr.DapDimension> |
redef |
protected java.util.Map<dap4.core.dmr.DapDimension,dap4.core.util.Slice> |
redefslice |
protected java.util.List<dap4.core.dmr.DapDimension> |
refdims |
protected java.util.List<CEConstraint.Segment> |
segments
"Map" of variables (at all levels) to be included
Maps variables -> associated slices
and is modified by computdimensions().
|
protected static java.util.Map<dap4.core.dmr.DapDataset,CEConstraint> |
universals |
protected java.util.List<dap4.core.dmr.DapVariable> |
variables
Also keep a raw list of variables
|
| Constructor and Description |
|---|
CEConstraint() |
CEConstraint(dap4.core.dmr.DapDataset dmr) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(dap4.core.dmr.DapNode node,
dap4.core.dmr.DapAttribute attr) |
void |
addRedef(dap4.core.dmr.DapDimension dim,
dap4.core.util.Slice slice) |
void |
addVariable(dap4.core.dmr.DapVariable var,
java.util.List<dap4.core.util.Slice> slices) |
protected static int |
compare(java.lang.Object lvalue,
java.lang.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(dap4.core.dmr.DapStructure dstruct,
java.util.Set<dap4.core.dmr.DapStructure> contracted)
Recursive helper
|
protected void |
dumpvar(CEConstraint.Segment seg,
java.lang.StringBuilder buf,
boolean forconstraint)
Recursive helper for tostring/toConstraintString
|
protected java.lang.Object |
eval(dap4.core.dmr.DapSequence seq,
dap4.core.data.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(dap4.core.dmr.DapStructure struct)
Count the number of fields of a structure that
already in this view.
|
protected static java.lang.Object |
fieldValue(dap4.core.dmr.DapSequence seq,
dap4.core.data.DataRecord record,
java.lang.String field) |
CEConstraint.FilterIterator |
filterIterator(dap4.core.dmr.DapSequence dapseq,
dap4.core.data.DataSequence dataseq)
Selection X Iterator
Filter evaluation using an iterator.
|
protected CEConstraint.Segment |
findSegment(dap4.core.dmr.DapVariable var) |
protected int |
findVariableIndex(dap4.core.dmr.DapVariable var) |
CEConstraint |
finish()
Finish creating this Constraint.
|
java.util.List<dap4.core.dmr.DapDimension> |
getConstrainedDimensions(dap4.core.dmr.DapVariable var) |
java.util.List<dap4.core.util.Slice> |
getConstrainedSlices(dap4.core.dmr.DapVariable var) |
dap4.core.dmr.DapDataset |
getDMR() |
dap4.core.dmr.DapDimension |
getRedefDim(dap4.core.dmr.DapDimension orig) |
static CEConstraint |
getUniversal(dap4.core.dmr.DapDataset dmr) |
protected boolean |
isWholeCompound(dap4.core.dmr.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(dap4.core.dmr.DapSequence seq,
dap4.core.data.DataRecord rec)
Selection X match
Evaluate a filter with respect to a Sequence record.
|
protected boolean |
matches(dap4.core.dmr.DapSequence seq,
dap4.core.data.DataRecord rec,
CEAST filter)
Evaluate a filter with respect to a Sequence record.
|
dap4.core.util.Odometer |
projectionIterator(dap4.core.dmr.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(dap4.core.dmr.DapNode node)
Reference X match
|
static void |
release(dap4.core.dmr.DapDataset dmr) |
void |
setFilter(dap4.core.dmr.DapVariable var,
CEAST filter) |
java.lang.String |
toConstraintString()
Convert the view to a constraint string suitable
for use in a URL, except not URL encoded.
|
java.lang.String |
toString() |
protected static java.util.Map<dap4.core.dmr.DapDataset,CEConstraint> universals
protected dap4.core.dmr.DapDataset dmr
protected java.util.List<CEConstraint.Segment> segments
protected java.util.List<dap4.core.dmr.DapVariable> variables
protected java.util.Map<dap4.core.dmr.DapDimension,dap4.core.util.Slice> redefslice
protected java.util.Map<dap4.core.dmr.DapNode,java.util.List<dap4.core.dmr.DapAttribute>> attributes
protected java.util.Map<dap4.core.dmr.DapDimension,dap4.core.dmr.DapDimension> redef
protected java.util.List<dap4.core.dmr.DapDimension> dimrefs
protected java.util.List<dap4.core.dmr.DapEnum> enums
protected java.util.List<dap4.core.dmr.DapGroup> groups
protected java.util.List<dap4.core.dmr.DapDimension> refdims
protected boolean finished
protected CEConstraint.Expand expansion
public CEConstraint()
public CEConstraint(dap4.core.dmr.DapDataset dmr)
public static CEConstraint getUniversal(dap4.core.dmr.DapDataset dmr)
public static void release(dap4.core.dmr.DapDataset dmr)
protected static java.lang.Object fieldValue(dap4.core.dmr.DapSequence seq,
dap4.core.data.DataRecord record,
java.lang.String field)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected static int compare(java.lang.Object lvalue,
java.lang.Object rvalue)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected java.lang.Object eval(dap4.core.dmr.DapSequence seq,
dap4.core.data.DataRecord record,
CEAST expr)
throws dap4.core.util.DapException
seq - the templaterecord - the record to evaluateexpr - the filterdap4.core.util.DapExceptionpublic dap4.core.dmr.DapDataset getDMR()
public dap4.core.dmr.DapDimension getRedefDim(dap4.core.dmr.DapDimension orig)
public void addRedef(dap4.core.dmr.DapDimension dim,
dap4.core.util.Slice slice)
public void addVariable(dap4.core.dmr.DapVariable var,
java.util.List<dap4.core.util.Slice> slices)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionpublic void addAttribute(dap4.core.dmr.DapNode node,
dap4.core.dmr.DapAttribute attr)
public void setFilter(dap4.core.dmr.DapVariable var,
CEAST filter)
public java.util.List<dap4.core.util.Slice> getConstrainedSlices(dap4.core.dmr.DapVariable var)
public java.util.List<dap4.core.dmr.DapDimension> getConstrainedDimensions(dap4.core.dmr.DapVariable var)
public java.lang.String toString()
toString in class java.lang.Objectpublic CEConstraint finish() throws dap4.core.util.DapException
dap4.core.util.DapExceptionpublic java.lang.String toConstraintString()
protected void dumpvar(CEConstraint.Segment seg, java.lang.StringBuilder buf, boolean forconstraint)
seg - buf - forconstraint - public boolean references(dap4.core.dmr.DapNode node)
node - to testpublic CEConstraint.ReferenceIterator referenceIterator() throws dap4.core.util.DapException
dap4.core.util.DapException - if could not create.public dap4.core.util.Odometer projectionIterator(dap4.core.dmr.DapVariable var)
throws dap4.core.util.DapException
var - over whose dimensions to iteratedap4.core.util.DapExceptionpublic boolean match(dap4.core.dmr.DapSequence seq,
dap4.core.data.DataRecord rec)
throws dap4.core.util.DapException
seq - the templaterec - the record to evaluatedap4.core.util.DapExceptionprotected boolean matches(dap4.core.dmr.DapSequence seq,
dap4.core.data.DataRecord rec,
CEAST filter)
throws dap4.core.util.DapException
seq - the templaterec - the record to evaluatefilter - the filterdap4.core.util.DapExceptionpublic CEConstraint.FilterIterator filterIterator(dap4.core.dmr.DapSequence dapseq, dap4.core.data.DataSequence dataseq) throws dap4.core.util.DapException
dapseq - dataseq - dap4.core.util.DapExceptionprotected int findVariableIndex(dap4.core.dmr.DapVariable var)
protected CEConstraint.Segment findSegment(dap4.core.dmr.DapVariable var)
public void expand()
public void contract()
protected boolean contractR(dap4.core.dmr.DapStructure dstruct,
java.util.Set<dap4.core.dmr.DapStructure> contracted)
dstruct - to contractcontracted - set of already contracted compoundsprotected int expansionCount(dap4.core.dmr.DapStructure struct)
struct - the dapstructure to checkdap4.core.util.DapExceptionprotected boolean isWholeCompound(dap4.core.dmr.DapStructure dstruct)
dstruct - to testprotected void computedimensions()
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected void computeenums()
protected void computegroups()