public abstract class CoreBaseBOp extends Object implements BOp
BOp
s.BOp.Annotations
Modifier and Type | Field and Description |
---|---|
protected static int |
DEFAULT_INITIAL_CAPACITY
The default initial capacity used for an empty annotation map -- empty
maps use the minimum initial capacity to avoid waste since we create a
large number of
BOp s during query evaluation. |
Constructor and Description |
---|
CoreBaseBOp() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
annotationsEqual(BOp o)
|
protected static boolean |
annotationsEqual(Map<String,Object> m1,
Map<String,Object> m2)
Compares two maps.
|
protected void |
annotationsToString(StringBuilder sb)
Add a string representation of annotations into a string builder.
|
protected void |
annotationsToString(StringBuilder sb,
int indent)
Add a string representation of annotations into a string builder.
|
protected void |
annotationValueToString(StringBuilder sb,
BOp val,
int indent)
Add a string representation of a BOp annotation value into a string builder.
|
protected void |
checkArgs(BOp[] args)
Check the operator argument.
|
CoreBaseBOp |
clone()
Deep copy clone semantics.
|
boolean |
equals(Object other)
true if all arguments and annotations are the same. |
BOpEvaluationContext |
getEvaluationContext()
Return the evaluation context for the operator as specified by
BOp.Annotations.EVALUATION_CONTEXT . |
int |
getId()
Return the
BOp.Annotations.BOP_ID . |
<T> T |
getProperty(String name,
T defaultValue)
Return the value of the named annotation.
|
Object |
getRequiredProperty(String name)
Return the value of the named annotation.
|
int |
hashCode()
The hash code is based on the hash of the operands (cached).
|
static String |
indent(int depth)
Returns a string that may be used to indent a dump of the nodes in the
tree.
|
boolean |
isController()
Return
true iff this operator is a controller. |
protected void |
mutation()
Invoked automatically any time a mutation operation occurs.
|
protected void |
shortenName(StringBuilder sb,
String longishName)
Append a name to a string buffer, possibly shortening the name.
|
String |
toShortString()
General contract is a short (non-recursive) representation of the
BOp . |
String |
toString()
Return a non-recursive representation of the arguments and annotations
for this
BOp . |
String |
toString(int indent)
The contract of this method at this level is under-specified.
|
finalize, getClass, notify, notifyAll, wait, wait, wait
annotations, argIterator, args, arity, get, setProperty, toArray, toArray
getProperty
protected static final transient int DEFAULT_INITIAL_CAPACITY
BOp
s during query evaluation.protected void checkArgs(BOp[] args)
args
- The arguments.IllegalArgumentException
- if the arguments are not valid for the operator.public CoreBaseBOp clone()
Deep copy clone of the operator.
public String toShortString()
BOp
.toShortString
in interface BOp
public String toString()
BOp
.protected void shortenName(StringBuilder sb, String longishName)
sb
- longishName
- protected void annotationsToString(StringBuilder sb)
annotationValueToString(StringBuilder, BOp, int)
in order to make this recursive.sb
- protected void annotationsToString(StringBuilder sb, int indent)
annotationValueToString(StringBuilder, BOp, int)
in order to make this recursive.sb
- protected void annotationValueToString(StringBuilder sb, BOp val, int indent)
sb
- The destination bufferval
- The BOp to serializeindent
- An indent to use if a recursive approach is chosen.public final Object getRequiredProperty(String name)
BOp
getRequiredProperty
in interface BOp
name
- The name of the annotation.http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6302954
public final <T> T getProperty(String name, T defaultValue)
BOp
getProperty
in interface BOp
T
- The generic type of the annotation value.name
- The name of the annotation.defaultValue
- The default value.public final int getId()
BOp
BOp.Annotations.BOP_ID
.public final boolean isController()
BOp
true
iff this operator is a controller.isController
in interface BOp
BOp.Annotations.CONTROLLER
public final BOpEvaluationContext getEvaluationContext()
BOp
BOp.Annotations.EVALUATION_CONTEXT
.getEvaluationContext
in interface BOp
public boolean equals(Object other)
true
if all arguments and annotations are the same.protected boolean annotationsEqual(BOp o)
true
iff the annotations of this BOp
and the
other BOp
are equals.
Note: This method permits override by subclasses with direct access to the maps to be compared.
annotationsEqual(Map, Map)
protected static final boolean annotationsEqual(Map<String,Object> m1, Map<String,Object> m2)
Arrays.equals(Object[], Object[])
to compare the values rather
than Object.equals(Object)
. Without this, two bops having array
annotation values which have the same data but different array instances
will not compare as equal.m1
- One set of annotations.m2
- Another set of annotations.true
iff the annotations have the same data.public int hashCode()
public static String indent(int depth)
Note: The string is capped out after a maximum supported depth.
depth
- The indentation depth.public String toString(int indent)
toString()
Or:
- return a pretty-print representation of the object with indent
Note that the former contract may or may not include recursive descent through a tree-like
object, whereas the latter almost certainly does.protected void mutation()
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.