public class Sort extends java.lang.Object implements Comparable
| Modifier and Type | Field and Description |
|---|---|
BitCode |
code
The bit vector code of this Sort.
|
int |
index
The index of this Sort (not necessarily its index in the sort code array).
|
java.lang.String |
name
The name of this Sort.
|
| Constructor and Description |
|---|
Sort(int index,
java.lang.String name,
BitCode code)
Constructs a Sort object with the specified index, name, and bit code.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addIsaDeclaration(java.lang.String name)
Adds the specified name to the set of names of immediate
supersorts of this sort, and returns true if it was not there
(ie., declared so) before.
|
BitCode |
ancestors()
Returns the set of ancestors of this sort as a BitCode.
|
static Sort |
bottom()
Returns the bottom sort as a static constant.
|
void |
clearIsaDeclarations()
Cleans up this sort by resetting its is-a declarations to null.
|
static int |
codeSize()
Returns the sort code size for an encoded taxonomy.
|
Context |
context() |
BitCode |
descendants()
Returns the set of descendants of this sort as a BitCode.
|
boolean |
equals(Sort sort)
Returns true iff this sort's name is equal to the specified one's.
|
BitCode |
getChildren()
Returns this sort's children (that is, its maximal lower bounds)
as set of sorts.
|
BitCode |
getParents()
Returns this sort's parents (that is, its minimal upper bounds)
as a set of sorts.
|
int |
height()
Returns the height of this Sort in its taxonomy.
|
boolean |
isBottom()
Return true iff this sort is bottom.
|
boolean |
isLocked()
Returns true iff this sort's bit code is locked - which means
that its bit code will not be modified by the 3 Boolean static
operations 'not', 'and', and 'or'.
|
boolean |
isStrictSubsortOf(Sort sort)
Returns true iff this sort is a strict subsort of the specified sort.
|
boolean |
isSubsortOf(Sort sort)
Returns true iff this sort is a subsort of the specified sort.
|
boolean |
isTop()
Return true iff this sort is top.
|
boolean |
isUnrelatedTo(Sort sort)
Returns true iff this sort is unrelated to the specified sort.
|
boolean |
lessThan(Comparable sort)
Returns true iff this is a strict lower sort of the specified
sort.
|
Sort |
lock()
Locks this sort's bit code - which means that its code will not
be modified by the 3 Boolean static bit code operations 'not',
'and', and 'or'.
|
int |
numberOfDescendants()
Returns the number of subsorts of this sort (not including itself).
|
boolean |
precedes(Sort sort)
This defines the "precedes" ordering as described in the specification.
|
Sort |
resetChildren()
Erases this sort's children.
|
void |
resetHeight() |
Sort |
resetParents()
Erases this sort's parents.
|
Sort |
setCode(BitCode code)
Sets the bit code of this Sort object to the specified bit code,
and returns this sort.
|
static void |
setCodeSize(int size)
Sets the sort code size for an encoded taxonomy.
|
Sort |
setContext(Context context) |
Sort |
setHeight(int height) |
Sort |
setIndex(int index)
Sets the index of this Sort object to the specified index, and
returns this sort.
|
static Sort |
top()
Returns the top sort as a static constant.
|
java.lang.String |
toString()
Returns a string form of this Sort object.
|
Sort |
unlock()
Unlocks this sort's bit code - which means that its code may be
modified by the 3 Boolean static bit code operations 'not',
'and', and 'or'.
|
public int index
public java.lang.String name
public BitCode code
public Sort(int index,
java.lang.String name,
BitCode code)
public Sort setIndex(int index)
public Sort setCode(BitCode code)
public boolean isSubsortOf(Sort sort)
public boolean isStrictSubsortOf(Sort sort)
public boolean isUnrelatedTo(Sort sort)
public Context context()
public static int codeSize()
throws LockedCodeArrayException
LockedCodeArrayExceptionpublic static void setCodeSize(int size)
throws LockedCodeArrayException
LockedCodeArrayExceptionpublic static Sort top()
public boolean isTop()
public static Sort bottom()
public boolean isBottom()
public boolean addIsaDeclaration(java.lang.String name)
public void clearIsaDeclarations()
public BitCode getParents()
public Sort resetParents()
public BitCode getChildren()
public Sort resetChildren()
public int height()
throws LockedCodeArrayException
LockedCodeArrayExceptionpublic Sort setHeight(int height)
public void resetHeight()
public int numberOfDescendants()
public BitCode descendants() throws LockedCodeArrayException
LockedCodeArrayExceptionpublic BitCode ancestors() throws LockedCodeArrayException
LockedCodeArrayExceptionpublic boolean lessThan(Comparable sort)
lessThan in interface Comparablepublic boolean precedes(Sort sort)
public boolean equals(Sort sort)
public Sort lock()
public Sort unlock()
public boolean isLocked()
public java.lang.String toString()
toString in class java.lang.Object