-
Method Summary
Modifier and TypeMethodDescriptionstatic Valueabsent()voidalias()bitwiseAnd(Item that) bitwiseAnd(Value that) bitwiseXor(Item that) bitwiseXor(Value that) body()booleanConverts thisValueinto a primitivebooleanvalue, if possible.booleanbooleanValue(boolean orElse) Converts thisValueinto a primitivebooleanvalue, if possible; otherwise returnsorElseif thisValuecan't be converted into a primitivebooleanvalue.branch()builder()byteConverts thisValueinto a primitivebytevalue, if possible.bytebyteValue(byte orElse) Converts thisValueinto a primitivebytevalue, if possible; otherwise returnsorElseif thisValuecan't be converted into a primitivebytevalue.charConverts thisValueinto a primitivecharvalue, if possible.charcharValue(char orElse) Converts thisValueinto a primitivecharvalue, if possible; otherwise returnsorElseif thisValuecan't be converted into a primitivecharvalue.commit()conditional(Item thenTerm, Item elseTerm) conditional(Value thenTerm, Value elseTerm) booleanReturnstrueif thisValueis aRecordthat has a member equal toitem; otherwise returnsfalseif thisValueis not aRecord, or if thisValueis aRecord, but has no member equal toitem.booleancontainsKey(String key) booleancontainsKey(Value key) booleancontainsValue(Value value) doubleConverts thisValueinto a primitivedoublevalue, if possible.doubledoubleValue(double orElse) Converts thisValueinto a primitivedoublevalue, if possible; otherwise returnsorElseif thisValuecan't be converted into a primitivedoublevalue.static Valueempty()static Valueextant()floatConverts thisValueinto a primitivefloatvalue, if possible.floatfloatValue(float orElse) Converts thisValueinto a primitivefloatvalue, if possible; otherwise returnsorElseif thisValuecan't be converted into a primitivefloatvalue.static ValuefromObject(Object object) getItem(int index) head()Returns the value of the first member of thisValue, if thisValueis aRecord, and its first member is anAttrwhosekeystring is equal totag; otherwise returnsAbsentif thisValueis not aRecord, or if thisValueis aRecordwhose first member is not anAttr, or if thisValueis aRecordwhose first member is anAttrwhosekeydoes not equal thetag.Returns theunflattenedheaderof thisValue, if thisValueis aRecord, and its first member is anAttrwhosekeystring is equal totag; otherwise returnsnull.Converts thisValueinto aBigIntegervalue, if possible.integerValue(BigInteger orElse) Converts thisValueinto aBigIntegervalue, if possible; otherwise returnsorElseif thisValuecan't be converted into aBigIntegervalue.intintValue()Converts thisValueinto a primitiveintvalue, if possible.intintValue(int orElse) Converts thisValueinto a primitiveintvalue, if possible; otherwise returnsorElseif thisValuecan't be converted into a primitiveintvalue.inverse()booleanbooleanbooleanReturnstrueif thisValueis not one of: an emptyRecord,False,Extant, orAbsent.booleanbooleanfinal Valuekey()booleanintlength()Returns the number of members contained in thisValue, if thisValueis aRecord; otherwise returns0if thisValueis not aRecord.longConverts thisValueinto a primitivelongvalue, if possible.longlongValue(long orElse) Converts thisValueinto a primitivelongvalue, if possible; otherwise returnsorElseif thisValuecan't be converted into a primitivelongvalue.negative()not()Converts thisValueinto aNumberobject, if possible.numberValue(Number orElse) Converts thisValueinto aNumberobject, if possible; otherwise returnsorElseif thisValuecan't be converted into aNumberobject.positive()shortConverts thisValueinto a primitiveshortvalue, if possible.shortshortValue(short orElse) Converts thisValueinto a primitiveshortvalue, if possible; otherwise returnsorElseif thisValuecan't be converted into a primitiveshortvalue.Converts thisValueinto aStringvalue, if possible.stringValue(String orElse) Converts thisValueinto aStringvalue, if possible; otherwise returnsorElseif thisValuecan't be converted into astringvalue.tag()Returns thekeystring of the first member of thisValue, if thisValueis aRecord, and its first member is anAttr; otherwise returnsnullif thisValueis not aRecord, or if thisValueis aRecordwhose first member is not anAttr.tail()Returns a view of all but the first member of thisValue, if thisValueis a non-emptyRecord; otherwise returns an emptyRecordif thisValueis not aRecord, of if thisValueis itself an emptyRecord.target()final ValuetoValue()Always returnsthisbecause everyValueis its own value component.Methods inherited from class swim.structure.Item
appended, appended, appended, appended, appended, appended, appended, appended, cast, cast, coerce, coerce, compareTo, concat, debug, display, equals, evaluate, evaluate, filter, filter, globalScope, hashCode, invoke, isConstant, iterator, max, min, precedence, prepended, prepended, prepended, prepended, prepended, prepended, prepended, prepended, substitute, substitute, toString, typeOrder, updated, updated, updated, updated, updated, updated, updated, updated, updated, updated, updated, updated, updated, updated, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlotMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
isDefined
public boolean isDefined() -
isDistinct
public boolean isDistinct()- Specified by:
isDistinctin classItem
-
isDefinite
public boolean isDefinite()Returnstrueif thisValueis not one of: an emptyRecord,False,Extant, orAbsent.- Specified by:
isDefinitein classItem
-
key
-
toValue
Always returnsthisbecause everyValueis its own value component. -
tag
Returns thekeystring of the first member of thisValue, if thisValueis aRecord, and its first member is anAttr; otherwise returnsnullif thisValueis not aRecord, or if thisValueis aRecordwhose first member is not anAttr.Used to concisely get the name of the discriminating attribute of a structure. The
tagcan be used to discern the nominal type of a polymorphic structure, similar to an XML element tag. -
target
Returns theflattenedmembers of thisValueafter all attributes have been removed, if thisValueis aRecord; otherwise returnsthisif thisValueis not aRecord.Used to concisely get the scalar value of an attributed structure. An attributed structure is a
Recordwith one or more attributes that modify one or more other members. -
flattened
Returns the sole member of thisValue, if thisValueis aRecordwith exactly one member, and its member is aValue; returnsExtantif thisValueis an emptyRecord; otherwise returnsthisif thisValueis aRecordwith more than one member, or if thisValueis not aRecord.Used to convert a unary
Recordinto its memberValue. Facilitates writing code that treats a unaryRecordequivalently to a bareValue. -
unflattened
Returnsthisif thisValueis aRecord; returns aRecordcontaining just thisValue, if thisValueisdistinct; otherwise returns an emptyRecordif thisValueisExtantorAbsent. Facilitates writing code that treats a bareValueequivalently to a unaryRecord.- Specified by:
unflattenedin classItem
-
header
Returns the value of the first member of thisValue, if thisValueis aRecord, and its first member is anAttrwhosekeystring is equal totag; otherwise returnsAbsentif thisValueis not aRecord, or if thisValueis aRecordwhose first member is not anAttr, or if thisValueis aRecordwhose first member is anAttrwhosekeydoes not equal thetag.Used to conditionally get the value of the head
Attrof a structure, if and only if the key string of the headAttris equal to thetag. Can be used to check if a structure might conform to a nominal type namedtag, while simultaneously getting the value of thetagattribute. -
headers
Returns theunflattenedheaderof thisValue, if thisValueis aRecord, and its first member is anAttrwhosekeystring is equal totag; otherwise returnsnull.The
headersof thetagattribute of a structure are like the attributes of an XML element tag; through unlike an XML element,tagattribute headers are not limited to string keys and values. -
head
-
tail
Returns a view of all but the first member of thisValue, if thisValueis a non-emptyRecord; otherwise returns an emptyRecordif thisValueis not aRecord, of if thisValueis itself an emptyRecord. -
body
-
length
public int length()Returns the number of members contained in thisValue, if thisValueis aRecord; otherwise returns0if thisValueis not aRecord. -
contains
Returnstrueif thisValueis aRecordthat has a member equal toitem; otherwise returnsfalseif thisValueis not aRecord, or if thisValueis aRecord, but has no member equal toitem. -
containsKey
Returnstrueif thisValueis aRecordthat has aFieldmember with a key that is equal to the givenkey; otherwise returnsfalseif thisValueis not aRecord, or if thisValueis aRecord, but has noFieldmember with a key equal to the givenkey.- Specified by:
containsKeyin classItem
-
containsKey
Returnstrueif thisValueis aRecordthat has aFieldwith aTextkey whose string value is equal to the givenkey; otherwise returnsfalseif thisValueis not aRecord, or if thisValueis aRecord, but has noFieldmember with aTextkey whose string value equals the givenkey. Equivalent tocontainsKey(Value), but avoids boxing thekeystring into aTextvalue.- Specified by:
containsKeyin classItem
-
containsValue
Returnstrueif thisValueis aRecordthat has aFieldmember with a value that is equal to the givenvalue; otherwise returnsfalseif thisValueis not aRecord, or if thisValueis aRecord, but has noFieldmember with a value equal to the givenvalue.- Specified by:
containsValuein classItem
-
get
-
get
Returns the value of the lastFieldmember of thisValuewith aTextkey whose string value is equal to the givenkey; returnsAbsentif thisValueis not aRecord, or if thisValueis aRecord, but has noFieldmember with aTextkey whose string value equals the givenkey. Equivalent toget(Value), but avoids boxing thekeystring into aTextvalue. -
getAttr
-
getAttr
Returns the value of the lastAttrmember of thisValuewith aTextkey whose string value is equal to the givenkey; returnsAbsentif thisValueis not aRecord, or if thisValueis aRecord, but has noAttrmember with aTextkey whose string value equals the givenkey. Equivalent togetAttr(Text), but avoids boxing thekeystring into aTextvalue. -
getSlot
-
getSlot
Returns the value of the lastSlotmember of thisValuewith aTextkey whose string value is equal to the givenkey; returnsAbsentif thisValueis not aRecord, or if thisValueis aRecord, but has noSlotmember with aTextkey whose string value equals the givenkey. Equivalent togetSlot(Value), but avoids boxing thekeystring into aTextvalue. -
getField
-
getField
Returns the lastFieldmember of thisValuewith aTextkey whose string value is equal to the givenkey; returnsnullif thisValueis not aRecord, or if thisValueis aRecord, but has noFieldmember with aTextkey whose string value equals the givenkey. Equivalent togetField(Value), but avoids boxing thekeystring into aTextvalue. -
getItem
-
removed
-
removed
-
conditional
- Specified by:
conditionalin classItem
-
conditional
-
or
-
or
-
and
-
and
-
bitwiseOr
-
bitwiseOr
-
bitwiseXor
- Specified by:
bitwiseXorin classItem
-
bitwiseXor
-
bitwiseAnd
- Specified by:
bitwiseAndin classItem
-
bitwiseAnd
-
lt
-
lt
-
le
-
le
-
eq
-
eq
-
ne
-
ne
-
ge
-
ge
-
gt
-
gt
-
plus
-
plus
-
minus
-
minus
-
times
-
times
-
divide
-
divide
-
modulo
-
modulo
-
not
-
bitwiseNot
- Specified by:
bitwiseNotin classItem
-
negative
-
positive
-
inverse
-
lambda
-
stringValue
Converts thisValueinto aStringvalue, if possible.- Specified by:
stringValuein classItem- Throws:
UnsupportedOperationException- if thisValuecan't be converted into aStringvalue.
-
stringValue
Converts thisValueinto aStringvalue, if possible; otherwise returnsorElseif thisValuecan't be converted into astringvalue.- Specified by:
stringValuein classItem
-
byteValue
public byte byteValue()Converts thisValueinto a primitivebytevalue, if possible.- Specified by:
byteValuein classItem- Throws:
UnsupportedOperationException- if thisValuecan't be converted into a primitivebytevalue.
-
byteValue
public byte byteValue(byte orElse) Converts thisValueinto a primitivebytevalue, if possible; otherwise returnsorElseif thisValuecan't be converted into a primitivebytevalue. -
shortValue
public short shortValue()Converts thisValueinto a primitiveshortvalue, if possible.- Specified by:
shortValuein classItem- Throws:
UnsupportedOperationException- if thisValuecan't be converted into a primitiveshortvalue.
-
shortValue
public short shortValue(short orElse) Converts thisValueinto a primitiveshortvalue, if possible; otherwise returnsorElseif thisValuecan't be converted into a primitiveshortvalue.- Specified by:
shortValuein classItem
-
intValue
public int intValue()Converts thisValueinto a primitiveintvalue, if possible.- Specified by:
intValuein classItem- Throws:
UnsupportedOperationException- if thisValuecan't be converted into a primitiveintvalue.
-
intValue
public int intValue(int orElse) Converts thisValueinto a primitiveintvalue, if possible; otherwise returnsorElseif thisValuecan't be converted into a primitiveintvalue. -
longValue
public long longValue()Converts thisValueinto a primitivelongvalue, if possible.- Specified by:
longValuein classItem- Throws:
UnsupportedOperationException- if thisValuecan't be converted into a primitivelongvalue.
-
longValue
public long longValue(long orElse) Converts thisValueinto a primitivelongvalue, if possible; otherwise returnsorElseif thisValuecan't be converted into a primitivelongvalue. -
floatValue
public float floatValue()Converts thisValueinto a primitivefloatvalue, if possible.- Specified by:
floatValuein classItem- Throws:
UnsupportedOperationException- if thisValuecan't be converted into a primitivefloatvalue.
-
floatValue
public float floatValue(float orElse) Converts thisValueinto a primitivefloatvalue, if possible; otherwise returnsorElseif thisValuecan't be converted into a primitivefloatvalue.- Specified by:
floatValuein classItem
-
doubleValue
public double doubleValue()Converts thisValueinto a primitivedoublevalue, if possible.- Specified by:
doubleValuein classItem- Throws:
UnsupportedOperationException- if thisValuecan't be converted into a primitivedoublevalue.
-
doubleValue
public double doubleValue(double orElse) Converts thisValueinto a primitivedoublevalue, if possible; otherwise returnsorElseif thisValuecan't be converted into a primitivedoublevalue.- Specified by:
doubleValuein classItem
-
integerValue
Converts thisValueinto aBigIntegervalue, if possible.- Specified by:
integerValuein classItem- Throws:
UnsupportedOperationException- if thisValuecan't be converted into aBigIntegervalue.
-
integerValue
Converts thisValueinto aBigIntegervalue, if possible; otherwise returnsorElseif thisValuecan't be converted into aBigIntegervalue.- Specified by:
integerValuein classItem
-
numberValue
Converts thisValueinto aNumberobject, if possible.- Specified by:
numberValuein classItem- Throws:
UnsupportedOperationException- if thisValuecan't be converted into aNumberobject.
-
numberValue
Converts thisValueinto aNumberobject, if possible; otherwise returnsorElseif thisValuecan't be converted into aNumberobject.- Specified by:
numberValuein classItem
-
charValue
public char charValue()Converts thisValueinto a primitivecharvalue, if possible.- Specified by:
charValuein classItem- Throws:
UnsupportedOperationException- if thisValuecan't be converted into a primitivecharvalue.
-
charValue
public char charValue(char orElse) Converts thisValueinto a primitivecharvalue, if possible; otherwise returnsorElseif thisValuecan't be converted into a primitivecharvalue. -
booleanValue
public boolean booleanValue()Converts thisValueinto a primitivebooleanvalue, if possible.- Specified by:
booleanValuein classItem- Throws:
UnsupportedOperationException- if thisValuecan't be converted into a primitivebooleanvalue.
-
booleanValue
public boolean booleanValue(boolean orElse) Converts thisValueinto a primitivebooleanvalue, if possible; otherwise returnsorElseif thisValuecan't be converted into a primitivebooleanvalue.- Specified by:
booleanValuein classItem
-
isAliased
public boolean isAliased() -
isMutable
public boolean isMutable() -
alias
public void alias() -
branch
-
commit
Description copied from class:Item -
keyEquals
-
builder
-
empty
-
extant
-
absent
-
fromObject
-