edu.isi.stella
Class Set

java.lang.Object
  extended by edu.isi.stella.Stella_Object
      extended by edu.isi.stella.StandardObject
          extended by edu.isi.stella.AbstractCollection
              extended by edu.isi.stella.Collection
                  extended by edu.isi.stella.Sequence
                      extended by edu.isi.stella.List
                          extended by edu.isi.stella.Set
Direct Known Subclasses:
WhynotProofClass

public class Set
extends List


Field Summary
 
Fields inherited from class edu.isi.stella.List
theConsList
 
Constructor Summary
Set()
           
 
Method Summary
 List concatenate(List set2, Cons othersets)
          Union set2 and all othersets onto the end of set1.
 int equalHashCode()
          Return an equalP hash code for self.
 void insert(Stella_Object value)
          Add value to the set self unless it is already a member.
 void insertLast(Stella_Object value)
          Add value to the end of set self unless it is already a member.
static Set newSet()
           
 boolean noDuplicatesP()
          Return true if the collection self forbids duplicate values.
 boolean objectEqualP(Stella_Object y)
          Return TRUE iff x and y are SET's with equivalent members.
 boolean orderedP()
          Return true if the collection self is ordered.
 Surrogate primaryType()
          Returns the primary type of self.
 void printObject(java.io.PrintStream stream)
           
 void push(Stella_Object value)
          Add value to the front of set self unless it is already a member.
 Collection removeDuplicates()
          Destructively remove duplicates from self and return the result.
 List substitute(Stella_Object renamed_New, Stella_Object old)
          Destructively replace old with renamed_New in the set self unless renamed_New is already a member.
 
Methods inherited from class edu.isi.stella.List
accessListSlotValue, allocateDestructiveListIterator, allocateIterator, butLast, clear, clOutputSystemClStructsFile, computeFileUnitsModule, consify, copy, cppSortUnitsForHeaderFile, createDerivedList, definedListP, difference, ejectDemon, emptyP, equivalentSetsP, extractStartupFunctionUnits, fifth, fifthSetter, first, firstSetter, fourth, fourthSetter, helpPrintContextTree, injectDemon, insertNew, intersection, last, lastPosition, length, list, listify, mapNullToNilList, memberP, membP, newList, nonEmptyP, nth, nthSetter, nullListP, pop, position, prepend, remove, removeDeletedMembers, removeDuplicatesEqual, removeIf, rest, reverse, second, secondSetter, sort, sortClStructClasses, subsetP, subtract, terminateListP, third, thirdSetter, union
 
Methods inherited from class edu.isi.stella.Sequence
sequence, yieldConsListFromSequence
 
Methods inherited from class edu.isi.stella.StandardObject
arrayTypeSpecifierP, baseTypeToTypeSpec, cantOverwriteActiveCollectionSlot, compatibleParameterTypesP, computeAnchoredTypeSpec, computeRelativeTypeSpec, conformingTypeSpecP, copyWrappedLiteral, cppNonPointerTypeP, cppReferenceTypeP, cppReferencizeType, cppTranslateAndPointerizeTypeSpec, cppTranslateAndReferencizeTypeSpec, cppTranslateTypeSpec, cppTypeWithoutInteriorPointersP, dropSlotValue, extractParameterType, extractRequiredArgumentValues, getSlot, hashCode_, idlTranslateTypeSpec, inverseSlotDemon, javaLiteralP, javaNativeLiteralWrapperNames, javaSpecialSetterName, javaTranslateArrayOfTypeSpec, javaTranslateTypeSpec, javaTranslateTypeSpecForFunction, javaTranslateTypeSpecHelper, javaYieldClassObjectArrayExpression, javaYieldClassObjectExpression, javaYieldFullyQualifiedTypeName, javaYieldTranslatedClassAndMethodNames, listifyTypeSpec, lookupClTypeFromStellaType, objectEqlP, putSlotValue, readSlotValue, runConstructorDemons, runDestructorDemons, runSlotDemons, runSlotGuardDemonsP, standardObjectP, subTypeSpecOfP, twoArgumentLeastCommonSupertype, typeSpecToBaseType, typeSpecToClass, typeToWalkedNullValueTree, validateTypeSpecifier, voidP, walkTypeSpecIsNativeTypeP, writeSlotValue, yieldTypeSpecTree
 
Methods inherited from class edu.isi.stella.Stella_Object
_, accessInContext, addPropertyValue, amPm, anchoredTypeSpecifierP, andOrNotTreeP, applyCoercionMethod, atomicExpressionP, bindToSurrogateP, booleanP, bootstrapIsaP, bquotify, cast, characterP, chooseSortPredicate, clConditionalizeTypeDeclarationTree, clTranslateAtomicTree, clTranslateATree, clTranslateBooleanTest, clTranslatePlainBooleanTest, clTranslateVerbatimBodySymbols, clYieldTypedExpressionTree, coerceATree, coerceEvaluatedTree, coerceMvTree, coerceOptionValue, coerceToBoolean, coerceToFloat, coerceToHashSet, coerceToModule, coerceToModuleName, coerceToString, coerceToSymbol, coerceToXmlElement, coerceValueToBoolean, coerceValueToFloat, coerceValueToString, coerceValueToType, coercibleP, collectFeatureList, collectKeyValueList, commonLispSymbolP, computeExpressionType, consifyListsAndIterators, consP, consTreeMatchP, convertToLiteral, copyConsTree, cppArgumentIsStreamP, cppBinaryOperatorP, cppBlockP, cppMaybeOutputStatementWithParentheses, cppOperatorP, cppOutputAtomicExpression, cppOutputLiteral, cppOutputOneActualParameter, cppOutputStatement, cppOutputTypedEntity, cppPrognifyStatement, cppPrognP, cppStatementToList, cppStreamIsStandardOutputP, cpptrans, cppTranslateAtomicTree, cppTranslateATree, cppTranslatedArrayTypeP, csValueP, dateDivider, dateTimeDivider, day, dealWithAmPm, dealWithEra, dealWithNoonMidn, decrementReferenceCount, defaultOptionHandler, defineSystem, defmodule, deletedP, describe, describeObject, describeTersely, destructureMethodNameTree, deUglifyParseTree, either, eqlP, eqlToBooleanP, eqlToCharacterP, eqlToFloatP, eqlToIntegerP, eqlToLongIntegerP, eqlToStringP, equalConsTreesP, equalP, era, estimatedEvaluationCost, evaluate, evaluateArgumentTree, evaluateAtomicTree, evaluateCommand, expandBquoteTree, filterModuleP, floatP, free, get, getObject, getProperty, hashlist, hashMemoizedArguments, helpBquotify, helpClTranslateATree, helpCoerceATree, helpLptrans, helpPrintOutline, helpTransformBooleanProceduralExpression, helpWalkATree, homeModule, hour, idlOutputAtomicExpression, idlOutputLiteral, idlOutputStatement, idlTranslateAtomicTree, idlTranslateATree, illegalTreeP, implodePathname, incrementallyTranslate, incrementReferenceCount, inlineUnwrapBoolean, inlineWrapBoolean, inModule, integerP, isaP, javaBinaryOperatorP, javaBlockP, javaEndOfLineTokenP, javaHelpOutputPrintStream, javaMaybeOutputStatementWithParentheses, javaOperatorP, javaOutputLiteral, javaOutputStatement, javaPrognP, javaStreamIsStandardOutputP, javaSymbolCaseP, javaTranslateAtomicTree, javaTranslateATree, javaTranslateWithNativeWrapper, jptrans, keywordP, legalTokenizerFromStateP, legalTokenizerStateP, legalTokenizerToStateP, literalEqlP, logLevelLE, longIntegerP, lptrans, makeEvaluatableBquoteTree, makeFileNameFromRelativePath, makeMemoizedValueEntry, makeMemoizedValueEntryn, matchConsTree, methodSlotP, minute, month, nameToString, nilP, noonMidn, numberWrapperToFloat, objectHashCode, one, oneI, onlyIf, parametricTypeSpecifierP, parseArrayDimensionsSpec, parseOptions, parseTokenizerCharacterSpec, parseTokenizerStateModifiers, permanentCopy, permanentify, permanentifyForm, po, prettyPrintLiteral, primaryClass, printOutline, printStellaCode, printStellaDefinition, printUndefinedSuperClasses, proceduralExpressionP, ptrans, publicSlots, registerRecycledItem, runOptionHandlerP, safeEqualHashCode, safeHashCode, safePrimaryType, safeYieldTypeSpecifier, searchConsTreeP, searchConsTreeWithFilterP, searchForObject, secondp, setProperty, sideEffectFreeExpressionP, simplifyBquoteTree, specialp, stella_Increment, stellaClassP, stellaCollectionP, stellaNeedToCompileP, stellaNeedToTranslateP, stellaObjectP, stellify, storageSlotP, stringifyInModule, stringP, substituteConsTree, substituteOnce, surrogateP, surrogatify, sweep, symbolCaseP, symbolP, sysTree, targetLanguageType, taxonomyIsaP, timeDivider, timeMultiply, tokenizerIncludeSpecP, tokenizerToStateAlias, tokenizerToStateName, toString, traceIf, traceKeywordP, transientifyForm, transientObjectP, transientSymbolP, translateWalkedTree, treeSize, treeToTrees, trueOptionP, tryToEvaluate, typeP, typify, unmake, unregisterRecycledItem, updateInContext, valuesTreeP, variableExpressionP, verbatimStringP, verbatimTreeP, vetOptions, vrletExpressionP, walkAtomicTree, walkATree, walkCollectionTree, walkDontCallMeTree, walkedExpressionExpression, walkedExpressionType, walkExpressionTree, walkMvExpressionTree, walkMvTree, walkStatement, walkTopLevelExpression, walkWithoutTypeTree, warnAboutUnknownSourceType, weekday, withinContext, withinModule, withinWorld, withStellaTokenizer, withSystemDefinition, withTokenizer, wrapperP, wrapWhereTest, xmlAttributeP, xmlBaseAttributeP, xmlCdataFormP, xmlCdataP, xmlDeclarationFormP, xmlDeclarationP, xmlDoctypeFormP, xmlElementFormP, xmlElementP, xmlGlobalAttributeP, xmlLocalAttributeP, xmlnsAttributeP, xmlProcessingInstructionFormP, xmlProcessingInstructionP, xmlTagCase, year, yieldCondTest, yieldCondTestOrTests, yieldHardcodedCaseSymbolIdOrIds, yieldInCursorClausesForArgumentList, yieldInCursorClausesForGeneralCollection, yieldInCursorClausesForVector, yieldTypeSpecifier, zone, zoneMinute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Set

public Set()
Method Detail

newSet

public static Set newSet()

equalHashCode

public int equalHashCode()
Return an equalP hash code for self. Note that this is O(N) in the number of elements of self.

Overrides:
equalHashCode in class List
Returns:
int

objectEqualP

public boolean objectEqualP(Stella_Object y)
Return TRUE iff x and y are SET's with equivalent members. Uses equalP to test equality of elements. This is more general than equivalentSetsP, since that only uses an eqlP test.

Overrides:
objectEqualP in class List
Parameters:
y -
Returns:
boolean

concatenate

public List concatenate(List set2,
                        Cons othersets)
Union set2 and all othersets onto the end of set1. The operation is destructive wrt set1, but leaves all other sets intact. The two mandatory parameters allow us to optimize the common binary case by not relying on the somewhat less efficient variable arguments mechanism.

Overrides:
concatenate in class List
Parameters:
set2 -
othersets -
Returns:
List

substitute

public List substitute(Stella_Object renamed_New,
                       Stella_Object old)
Destructively replace old with renamed_New in the set self unless renamed_New is already a member.

Overrides:
substitute in class List
Parameters:
renamed_New -
old -
Returns:
List

removeDuplicates

public Collection removeDuplicates()
Description copied from class: List
Destructively remove duplicates from self and return the result. Preserves the original order of the remaining members.

Overrides:
removeDuplicates in class List
Returns:
Collection

insertLast

public void insertLast(Stella_Object value)
Add value to the end of set self unless it is already a member.

Overrides:
insertLast in class List
Parameters:
value -

push

public void push(Stella_Object value)
Add value to the front of set self unless it is already a member.

Overrides:
push in class List
Parameters:
value -

insert

public void insert(Stella_Object value)
Add value to the set self unless it is already a member.

Overrides:
insert in class List
Parameters:
value -

orderedP

public boolean orderedP()
Description copied from class: Collection
Return true if the collection self is ordered.

Overrides:
orderedP in class Sequence
Returns:
boolean

noDuplicatesP

public boolean noDuplicatesP()
Description copied from class: Collection
Return true if the collection self forbids duplicate values.

Overrides:
noDuplicatesP in class Collection
Returns:
boolean

printObject

public void printObject(java.io.PrintStream stream)
Overrides:
printObject in class List

primaryType

public Surrogate primaryType()
Description copied from class: Stella_Object
Returns the primary type of self. Gets defined automatically for every non-abstract subclass of OBJECT.

Overrides:
primaryType in class List
Returns:
Surrogate