edu.isi.stella
Class Vector

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
Direct Known Subclasses:
BooleanVector, ExtensibleVector, IntegerVector, VectorSequence

public class Vector
extends Sequence


Field Summary
 int arraySize
           
 Stella_Object[] theArray
           
 
Constructor Summary
Vector()
           
 
Method Summary
static Stella_Object accessVectorSlotValue(Vector self, Symbol slotname, Stella_Object value, boolean setvalueP)
           
 AbstractIterator allocateIterator()
           
 Iterator butLast()
          Generate all but the last element of the vector self.
 void clear()
           
 Cons consify()
          Return a list of elements in self.
 Vector copy()
          Return a copy of the vector self.
 boolean emptyP()
          Return true if self has length 0.
 int equalHashCode()
          Return an equalP hash code for self.
 Stella_Object fifth()
           
 Stella_Object fifthSetter(Stella_Object value)
           
 Stella_Object first()
           
 Stella_Object firstSetter(Stella_Object value)
           
 Stella_Object fourth()
           
 Stella_Object fourthSetter(Stella_Object value)
           
 void initializeVector()
           
 void insertAt(int offset, Stella_Object value)
           
 Stella_Object last()
          Return the last item in the vector self.
 int lastPosition(Stella_Object renamed_Object, int end)
          Return the position of renamed_Object within the vector self (counting from zero); or return null if renamed_Object does not occur within self (uses an eqlP test).
 Stella_Object lastSetter(Stella_Object value)
           
 int length()
           
 List listify()
          Return a list of elements in self.
 boolean memberP(Stella_Object renamed_Object)
          Return TRUE if value is a member of the sequence self.
static Vector newVector(int arraySize)
           
 boolean nonEmptyP()
          Return true if self has length > 0.
 Stella_Object nth(int position)
           
 Stella_Object nthSetter(Stella_Object value, int position)
           
 boolean objectEqualP(Stella_Object y)
          Return TRUE iff the vectors x and y are structurally equivalent.
 int position(Stella_Object renamed_Object, int start)
          Return the position of renamed_Object within the vector self (counting from zero); or return null if renamed_Object does not occur within self (uses an eqlP test).
 Surrogate primaryType()
          Returns the primary type of self.
 void printObject(java.io.PrintStream stream)
           
 void printVector(java.io.PrintStream stream)
           
static void resizeVector(Vector self, int size)
          Change the size of self to size.
 Stella_Object second()
           
 Stella_Object secondSetter(Stella_Object value)
           
 Stella_Object third()
           
 Stella_Object thirdSetter(Stella_Object value)
           
 
Methods inherited from class edu.isi.stella.Sequence
orderedP, yieldConsListFromSequence
 
Methods inherited from class edu.isi.stella.Collection
insert, noDuplicatesP, remove
 
Methods inherited from class edu.isi.stella.StandardObject
arrayTypeSpecifierP, baseTypeToTypeSpec, cantOverwriteActiveCollectionSlot, compatibleParameterTypesP, computeAnchoredTypeSpec, computeRelativeTypeSpec, conformingTypeSpecP, copyWrappedLiteral, cppReferenceTypeP, cppReferencizeType, cppTranslateAndPointerizeTypeSpec, cppTranslateAndReferencizeTypeSpec, cppTranslateTypeSpec, 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, amPm, anchoredTypeSpecifierP, andOrNotTreeP, applyCoercionMethod, atomicExpressionP, bindToSurrogateP, booleanP, bootstrapIsaP, bquotify, cast, characterP, clTranslateAtomicTree, clTranslateATree, clTranslateBooleanTest, clTranslatePlainBooleanTest, clTranslateVerbatimBodySymbols, clYieldTypedExpressionTree, coerceATree, coerceEvaluatedTree, coerceMvTree, coerceToBoolean, coerceToModule, coerceToModuleName, coerceToSymbol, coerceToXmlElement, coercibleP, collectFeatureList, collectKeyValueList, commonLispSymbolP, computeExpressionType, cons, 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, eqlToStringP, equalConsTreesP, equalP, era, estimatedEvaluationCost, evaluate, evaluateArgumentTree, evaluateAtomicTree, evaluateCommand, expandBquoteTree, filterModuleP, floatP, free, get, getObject, 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, kvCons, legalTokenizerFromStateP, legalTokenizerStateP, legalTokenizerToStateP, literalEqlP, logLevelLE, lptrans, makeFileNameFromRelativePath, makeMemoizedValueEntry, makeMemoizedValueEntryn, matchConsTree, methodSlotP, minute, month, nameToString, nilP, noonMidn, numberWrapperToFloat, objectHashCode, one, oneI, onlyIf, parametricTypeSpecifierP, parseArrayDimensionsSpec, 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, 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, walkedExpressionType, walkExpressionTree, walkMvExpressionTree, walkMvTree, walkStatement, walkTopLevelExpression, walkWithoutTypeTree, warnAboutUnknownSourceType, weekday, withinContext, withinModule, withinWorld, withStellaTokenizer, withSystemDefinition, withTokenizer, wrapperP, wrapWhereTest, xmlAttributeP, xmlCdataFormP, xmlCdataP, xmlDeclarationFormP, xmlDeclarationP, xmlDoctypeFormP, xmlElementFormP, xmlElementP, 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

arraySize

public int arraySize

theArray

public Stella_Object[] theArray
Constructor Detail

Vector

public Vector()
Method Detail

newVector

public static Vector newVector(int arraySize)

butLast

public Iterator butLast()
Generate all but the last element of the vector self.

Returns:
Iterator

allocateIterator

public AbstractIterator allocateIterator()
Overrides:
allocateIterator in class Sequence

equalHashCode

public int equalHashCode()
Return an equalP hash code for self.

Overrides:
equalHashCode in class Stella_Object
Returns:
int

objectEqualP

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

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

clear

public void clear()

copy

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

Returns:
Vector

insertAt

public void insertAt(int offset,
                     Stella_Object value)

lastPosition

public int lastPosition(Stella_Object renamed_Object,
                        int end)
Return the position of renamed_Object within the vector self (counting from zero); or return null if renamed_Object does not occur within self (uses an eqlP test). If end was supplied as non-null, only consider the portion ending at index end, however, the returned position will always be relative to the entire vector.

Parameters:
renamed_Object -
end -
Returns:
int

position

public int position(Stella_Object renamed_Object,
                    int start)
Return the position of renamed_Object within the vector self (counting from zero); or return null if renamed_Object does not occur within self (uses an eqlP test). If start was supplied as non-null, only consider the portion starting at start, however, the returned position will always be relative to the entire vector.

Parameters:
renamed_Object -
start -
Returns:
int

memberP

public boolean memberP(Stella_Object renamed_Object)
Description copied from class: Sequence
Return TRUE if value is a member of the sequence self.

Overrides:
memberP in class Sequence
Returns:
boolean

length

public int length()
Overrides:
length in class Sequence

lastSetter

public Stella_Object lastSetter(Stella_Object value)

nthSetter

public Stella_Object nthSetter(Stella_Object value,
                               int position)

fifthSetter

public Stella_Object fifthSetter(Stella_Object value)

fourthSetter

public Stella_Object fourthSetter(Stella_Object value)

thirdSetter

public Stella_Object thirdSetter(Stella_Object value)

secondSetter

public Stella_Object secondSetter(Stella_Object value)

firstSetter

public Stella_Object firstSetter(Stella_Object value)

last

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

Returns:
Stella_Object

nth

public Stella_Object nth(int position)

fifth

public Stella_Object fifth()

fourth

public Stella_Object fourth()

third

public Stella_Object third()

second

public Stella_Object second()

first

public Stella_Object first()

nonEmptyP

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

Returns:
boolean

emptyP

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

Returns:
boolean

printVector

public void printVector(java.io.PrintStream stream)

listify

public List listify()
Return a list of elements in self.

Returns:
List

consify

public Cons consify()
Return a list of elements in self.

Overrides:
consify in class Stella_Object
Returns:
Cons

resizeVector

public static void resizeVector(Vector self,
                                int size)
Change the size of self to size. If size is smaller than the current size of self the vector will be truncated. Otherwise, the internal array of self will be grown to size and unused elements will be initialized to NULL.

Parameters:
self -
size -

initializeVector

public void initializeVector()

printObject

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

accessVectorSlotValue

public static Stella_Object accessVectorSlotValue(Vector 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 Stella_Object
Returns:
Surrogate