public class NILPointer extends AbstractAST
NILPointer implements the constant object
F#NIL (not in list), which indicates in the evaluation process
that no evaluation was possible (i.e. no further definition was found to
create a new expression from the existing one).F.NIL,
Serialized FormAbstractAST.ASTIteratorIAST.PROPERTYfEvalFlags, hashValueCONTAINS_DEFAULT_PATTERN, CONTAINS_NO_DEFAULT_PATTERN_MASK, CONTAINS_NO_PATTERN, CONTAINS_PATTERN, CONTAINS_PATTERN_EXPR, CONTAINS_PATTERN_SEQUENCE, IS_ALL_EXPANDED, IS_DECOMPOSED_PARTIAL_FRACTION, IS_EXPANDED, IS_FLAT_ORDERLESS_EVALED, IS_FLATTENED, IS_FLATTENED_OR_SORTED_MASK, IS_LISTABLE_THREADED, IS_MATRIX, IS_MATRIX_OR_VECTOR, IS_SORTED, IS_VECTOR, NO_FLAGASTID, BLANKID, COMPLEXID, DOUBLECOMPLEXID, DOUBLEID, FRACTIONID, INTEGERID, METHODSYMBOLID, PATTERNID, STRINGID, SYMBOLID| Modifier | Constructor and Description |
|---|---|
protected |
NILPointer()
The class
NILPointer implements the constant object
F#NIL (not in list), which indicates in the evaluation
process that no evaluation was possible (i.e. no further definition was
found to create a new expression from the existing one). |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(IExpr object) |
void |
add(int location,
IExpr object) |
boolean |
addAll(java.util.Collection<? extends IExpr> collection) |
boolean |
addAll(int location,
java.util.Collection<? extends IExpr> collection) |
boolean |
addAll(java.util.List<? extends IExpr> ast)
Appends all of the arguments (starting from offset
1) in the
specified AST to the end of this AST. |
boolean |
addAll(java.util.List<? extends IExpr> ast,
int startPosition,
int endPosition)
Appends all elements from offset
startPosition to
endPosition in the specified AST to the end of this AST. |
IAST |
addOneIdentity(IAST subAST)
Add an
subAST with attribute OneIdentity for
example Plus[] or Times[]. |
IExpr |
arg1()
Get the first argument (i.e. the second element of the underlying list
structure) of the
AST function (i.e. get(1) ). |
IExpr |
arg2()
Get the second argument (i.e. the third element of the underlying list
structure) of the
AST function (i.e. get(2) ). |
IExpr |
arg3()
Get the third argument (i.e. the fourth element of the underlying list
structure) of the
AST function (i.e. get(3) ). |
IExpr |
arg4()
Get the fourth argument (i.e. the fifth element of the underlying list
structure) of the
AST function (i.e. get(4) ). |
IExpr |
arg5()
Get the fifth argument (i.e. the sixth element of the underlying list
structure) of the
AST function (i.e. get(5) ). |
java.util.Set<IExpr> |
asSet()
Collect all arguments of this AST in a new set.
|
void |
clear() |
IAST |
clone()
Returns a shallow copy of this
IAST instance (the elements
themselves are not cloned). |
boolean |
equals(java.lang.Object obj)
Test if this is equal to b.
|
IExpr |
evaluate(EvalEngine engine)
Evaluate an expression
|
int |
hashCode()
Hashcode of this Element.
|
IExpr |
head()
If this object is an instance of
IAST get the first element
(offset 0) of the IAST list (i.e. get(0) ). |
boolean |
isAST()
Test if this expression is an AST list, which contains a header
element (i.e. the function name) at index position
0 and
some optional argument elements at the index positions
1..n. |
boolean |
isAST(IExpr header)
Test if this expression is an AST list, which contains the given
header element at index position
0 and some optional
argument elements at the index positions
1.. |
boolean |
isPresent()
Return
true if this expression unequals F.NIL,
otherwise false. |
boolean |
isSameHead(IExpr head)
Check if the object at index 0 (i.e. the head of the list) is the same
object as
head |
boolean |
isSameHead(IExpr head,
int length)
Check if the object at index 0 (i.e. the head of the list) is the same
object as
head and if the size of the list equals
length. |
boolean |
isSameHead(IExpr head,
int minLength,
int maxLength)
Check if the object at index 0 (i.e. the head of the list) is the same
object as
head and if the size of the list is between
minLength and maxLength. |
boolean |
isSameHeadSizeGE(IExpr head,
int length)
Check if the object at index 0 (i.e. the head of the list) is the same
object as
head and if the size of the list is greater or
equal length. |
IExpr |
orElse(IExpr other)
Return
this if this unequals F.NIL
, otherwise return other. . |
IExpr |
orElseGet(java.util.function.Supplier<? extends IExpr> other)
Return
this if this unequals F.NIL
, otherwise invoke other and return the result of that
invocation. |
<X extends java.lang.Throwable> |
orElseThrow(java.util.function.Supplier<? extends X> exceptionSupplier)
Return
this if this unequals F.NIL
, otherwise throw an exception to be created by the provided supplier. |
IExpr |
remove(int location) |
boolean |
remove(java.lang.Object object) |
protected void |
removeRange(int start,
int end)
Removes the objects in the specified range from the start to the end, but
not including the end index.
|
IExpr |
set(int location,
IExpr object)
Replaces the element at the specified location in this
ArrayList
with the specified object. |
int |
size()
Returns the number of elements in this
ArrayList. |
java.lang.Object[] |
toArray()
Returns a new array containing all elements contained in this
ArrayList. |
java.lang.String |
toString() |
$div, $minus, $plus, $times, $up, abs, accept, accept, accept, accept, addAtClone, addEvalFlags, and, appendClone, apply, apply, apply, apply, apply, args, asType, clearHashCache, compareTo, contains, copy, copyFrom, copyHead, copyUntil, copyUntil, dec, divide, egcd, equalsAt, equalsFromPosition, evalComplex, evalDouble, evalNumber, evalSignedNumber, factory, filter, filter, filter, filter, filter, filter, filter, findFirstEquals, forEach, fullFormString, gcd, get, getAST, getAt, getEvalFlags, getHashCache, getInt, getList, getNumber, getOneIdentity, getPart, getPart, hierarchy, inc, indexOf, internalFormString, internalJavaString, internalScalaString, inverse, isAllExpanded, isAnd, isArcCos, isArcCosh, isArcSin, isArcSinh, isArcTan, isArcTanh, isAST, isAST, isAST, isAST, isAST, isASTSizeGE, isAtom, isComplex, isComplexInfinity, isComplexNumeric, isCondition, isCos, isCosh, isDerivative, isDirectedInfinity, isEmpty, isEvalFlagOff, isEvalFlagOn, isExpanded, isFlatAST, isFraction, isFree, isFree, isFree, isFreeAST, isFreeAST, isFreeAt, isFreeOfPatterns, isFunction, isGEOrdered, isGTOrdered, isInfinity, isInteger, isIntegerResult, isList, isListOfLists, isLog, isMatrix, isMember, isModule, isNegative, isNegativeInfinity, isNegativeResult, isNonNegativeResult, isNot, isNumber, isNumeric, isNumericFunction, isNumericMode, isOr, isOrderlessAST, isPatternExpr, isPlus, isPlusTimesPower, isPolynomial, isPolynomial, isPolynomialOfMaxDegree, isPolynomialOfMaxDegree, isPositive, isPositiveResult, isPower, isRationalResult, isRealResult, isRuleAST, isSame, isSame, isSequence, isSignedNumber, isSin, isSinh, isSlot, isSlotSequence, isSpan, isTan, isTanh, isTimes, isUnit, isValue, isVector, iterator, iterator0, last, lastIndexOf, leafCount, leaves, map, map, map, map, mapAt, mapAt, minus, mod, multiply, negate, negative, opposite, optional, or, patternHashCode, plus, power, power, prependClone, range, range, range, remainder, removeAtClone, replaceAll, replaceAll, replacePart, replaceRepeated, replaceRepeated, replaceSlots, setAtClone, setEvalFlags, signum, subtract, sum, times, timesDistributed, topHead, toScript, toScriptFactory, variables2SlotscontainsAll, removeAll, retainAll, toArrayfinalize, getClass, notify, notifyAll, wait, wait, waitevaluateHead, getField, ifPresent, isBlank, isConstant, isE, isFalse, isIndeterminate, isLEOrdered, isLTOrdered, isMember, isMinusOne, isNumEqualInteger, isNumEqualRational, isNumIntValue, isOne, isONE, isPattern, isPatternDefault, isPatternSequence, isPi, isRational, isRationalValue, isSymbol, isTrue, isVariable, isZero, isZERO, multiply, ofNullable, reciprocalprotected NILPointer()
NILPointer implements the constant object
F#NIL (not in list), which indicates in the evaluation
process that no evaluation was possible (i.e. no further definition was
found to create a new expression from the existing one).F.NILpublic boolean add(IExpr object)
public void add(int location,
IExpr object)
public boolean addAll(java.util.Collection<? extends IExpr> collection)
public boolean addAll(int location,
java.util.Collection<? extends IExpr> collection)
public boolean addAll(java.util.List<? extends IExpr> ast)
IAST1) in the
specified AST to the end of this AST.ast - AST containing elements to be added to this ASTList.add(Object)public boolean addAll(java.util.List<? extends IExpr> ast, int startPosition, int endPosition)
IASTstartPosition to
endPosition in the specified AST to the end of this AST.ast - AST containing elements to be added to this ASTstartPosition - the start position, inclusive.endPosition - the ending position, exclusive.List.add(Object)public IAST addOneIdentity(IAST subAST)
IASTsubAST with attribute OneIdentity for
example Plus[] or Times[].subAST - an ast with attribute OneIdentity.this ast after adding the subASTpublic IExpr arg1()
IASTAST function (i.e. get(1) ). Sin(x), arg1() returns x.AST.IExpr.head()public IExpr arg2()
IASTAST function (i.e. get(2) ). x^y
(i.e. Power(x, y)), arg2() returns
y.AST.IExpr.head()public IExpr arg3()
IASTAST function (i.e. get(3) ).f(a, b, c), arg3() returns c.AST.IExpr.head()public IExpr arg4()
IASTAST function (i.e. get(4) ).f(a, b ,c, d), arg4() returns d.AST.IExpr.head()public IExpr arg5()
IASTAST function (i.e. get(5) ).f(a, b ,c, d, e), arg5() returns e
.AST.IExpr.head()public java.util.Set<IExpr> asSet()
IASTpublic void clear()
public IAST clone()
IASTIAST instance (the elements
themselves are not cloned).clone in interface IASTclone in class AbstractASTIAST instance.public boolean equals(java.lang.Object obj)
edu.jas.structure.Elementequals in interface edu.jas.structure.Element<IExpr>equals in interface java.util.Collection<IExpr>equals in interface java.util.List<IExpr>equals in class AbstractASTpublic final IExpr evaluate(EvalEngine engine)
IExprevaluate in interface IExprevaluate in class AbstractASTengine - the evaluation engineF.NIL if the evaluation is
not possible (i.e. the evaluation doesn't change the object).public int hashCode()
edu.jas.structure.ElementhashCode in interface edu.jas.structure.Element<IExpr>hashCode in interface java.util.Collection<IExpr>hashCode in interface java.util.List<IExpr>hashCode in class AbstractASTpublic final IExpr head()
IExprIAST get the first element
(offset 0) of the IAST list (i.e. get(0) ).public final boolean isAST()
AbstractAST0 and
some optional argument elements at the index positions
1..n. Therefore this expression is no atomic
expression.isAST in interface IExprisAST in class AbstractASTIExpr.isAtom()public final boolean isAST(IExpr header)
AbstractAST0 and some optional
argument elements at the index positions
1..(size()-1). Therefore this expression is not an atomic
expression.isAST in interface IExprisAST in class AbstractASTIExpr.isAtom()public final boolean isPresent()
IExprtrue if this expression unequals F.NIL,
otherwise false. This method is similar to
java.util.Optional#isPresent().true if the expression unequals F.NIL,
otherwise false.Optional.isPresent()public boolean isSameHead(IExpr head)
AbstractASTheadisSameHead in class AbstractASThead - object to compare with element at location 0public boolean isSameHead(IExpr head, int length)
AbstractASThead and if the size of the list equals
length.isSameHead in class AbstractASThead - object to compare with element at location 0public boolean isSameHead(IExpr head, int minLength, int maxLength)
AbstractASThead and if the size of the list is between
minLength and maxLength.isSameHead in class AbstractASThead - object to compare with element at location 0minLength - minimum length of list elements.maxLength - maximum length of list elements.public boolean isSameHeadSizeGE(IExpr head, int length)
AbstractASThead and if the size of the list is greater or
equal length.isSameHeadSizeGE in class AbstractASThead - object to compare with element at location 0public final IExpr orElse(IExpr other)
IExprthis if this unequals F.NIL
, otherwise return other. .Optional.orElse(Object)public final IExpr orElseGet(java.util.function.Supplier<? extends IExpr> other)
IExprthis if this unequals F.NIL
, otherwise invoke other and return the result of that
invocation.other - a Supplier whose result is returned if no value is
presentthis if this unequals
F.NIL, otherwise the result of other.get()public final <X extends java.lang.Throwable> IExpr orElseThrow(java.util.function.Supplier<? extends X> exceptionSupplier) throws X extends java.lang.Throwable
IExprthis if this unequals F.NIL
, otherwise throw an exception to be created by the provided supplier.X - Type of the exception to be thrownexceptionSupplier - The supplier which will return the exception to be thrownthis if this unequals
F.NIL or throw an exceptionX - if there is no value presentX extends java.lang.Throwablepublic IExpr remove(int location)
public boolean remove(java.lang.Object object)
protected void removeRange(int start,
int end)
removeRange in class java.util.AbstractList<IExpr>start - the index at which to start removing.end - the index one after the end of the range to remove.java.lang.IndexOutOfBoundsException - when start < 0, start > end or end > size()public IExpr set(int location, IExpr object)
ArrayList
with the specified object.set in interface java.util.List<IExpr>set in class java.util.AbstractList<IExpr>location - the index at which to put the specified object.object - the object to add.java.lang.IndexOutOfBoundsException - when location < 0 || >= size()public int size()
ArrayList.size in interface java.util.Collection<IExpr>size in interface java.util.List<IExpr>size in class AbstractASTArrayList.public java.lang.Object[] toArray()
ArrayList.public java.lang.String toString()
toString in class AbstractAST