edu.isi.stella
Class VectorSequence

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.Vector
                          extended by edu.isi.stella.VectorSequence
Direct Known Subclasses:
CustomVectorSequence

public class VectorSequence
extends Vector

Extensible sequence implemented by a vector. Whenever we run out of room, we grow the sequence by a factor of two. Note that this keeps the average insertion cost per element constant. This is generally preferable over linked lists unless we need within-list insertions or removals, since it uses less space and has better cache locality.


Field Summary
 int sequenceLength
           
 
Fields inherited from class edu.isi.stella.Vector
arraySize, theArray
 
Constructor Summary
VectorSequence()
           
 
Method Summary
static Stella_Object accessVectorSequenceSlotValue(VectorSequence self, Symbol slotname, Stella_Object value, boolean setvalueP)
           
 void clear()
          Clear self by setting its active length to zero.
 Vector copy()
          Return a copy of the vector sequence self.
static void copyVectorSequence(VectorSequence source, VectorSequence copy)
           
 boolean emptyP()
          Return true if self has length 0.
 void insert(Stella_Object value)
          Append value to the END of the sequence self.
 Stella_Object last()
          Return the last item in the vector self.
 Stella_Object lastSetter(Stella_Object value)
           
 int length()
           
static VectorSequence newVectorSequence(int arraySize)
           
 boolean nonEmptyP()
          Return true if self has length > 0.
 boolean objectEqualP(Stella_Object y)
          Return TRUE iff the sequences x and y are structurally equivalent.
 Surrogate primaryType()
          Returns the primary type of self.
 AbstractCollection remove(Stella_Object value)
          Remove value from the sequence self, and left shift the values after it to close the gap.
 VectorSequence reverse()
          Reverse the order of elements in the active portion of self.
 
Methods inherited from class edu.isi.stella.Vector
accessVectorSlotValue, allocateIterator, butLast, consify, equalHashCode, fifth, fifthSetter, first, firstSetter, fourth, fourthSetter, initializeVector, insertAt, lastPosition, listify, memberP, newVector, nth, nthSetter, position, printObject, printVector, resizeVector, second, secondSetter, sort, third, thirdSetter
 
Methods inherited from class edu.isi.stella.Sequence
orderedP, sequence, yieldConsListFromSequence
 
Methods inherited from class edu.isi.stella.Collection
noDuplicatesP
 
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
 

Field Detail

sequenceLength

public int sequenceLength
Constructor Detail

VectorSequence

public VectorSequence()
Method Detail

newVectorSequence

public static VectorSequence newVectorSequence(int arraySize)

objectEqualP

public boolean objectEqualP(Stella_Object y)
Return TRUE iff the sequences x and y are structurally equivalent. Uses equalP to test equality of elements.

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

clear

public void clear()
Clear self by setting its active length to zero.

Overrides:
clear in class Vector

copy

public Vector copy()
Return a copy of the vector sequence self.

Overrides:
copy in class Vector
Returns:
Vector

copyVectorSequence

public static void copyVectorSequence(VectorSequence source,
                                      VectorSequence copy)

reverse

public VectorSequence reverse()
Reverse the order of elements in the active portion of self.

Returns:
VectorSequence

remove

public AbstractCollection remove(Stella_Object value)
Remove value from the sequence self, and left shift the values after it to close the gap.

Overrides:
remove in class Collection
Parameters:
value -
Returns:
AbstractCollection

insert

public void insert(Stella_Object value)
Append value to the END of the sequence self. Resize the array if necessary.

Overrides:
insert in class Collection
Parameters:
value -

lastSetter

public Stella_Object lastSetter(Stella_Object value)
Overrides:
lastSetter in class Vector

last

public Stella_Object last()
Return the last item in the vector self.

Overrides:
last in class Vector
Returns:
Stella_Object

length

public int length()
Overrides:
length in class Vector

nonEmptyP

public boolean nonEmptyP()
Return true if self has length > 0.

Overrides:
nonEmptyP in class Vector
Returns:
boolean

emptyP

public boolean emptyP()
Return true if self has length 0.

Overrides:
emptyP in class Vector
Returns:
boolean

accessVectorSequenceSlotValue

public static Stella_Object accessVectorSequenceSlotValue(VectorSequence self,
                                                          Symbol slotname,
                                                          Stella_Object value,
                                                          boolean setvalueP)

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 Vector
Returns:
Surrogate