Class DeclarationList
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Declaration>
,Collection<Declaration>
,List<Declaration>
,RandomAccess
,SequencedCollection<Declaration>
Declaration List.
This is a utility class to hold local declaration lists in declaration scopes.
Link to GitHub: Source File.
- Author:
- Øystein Myhre Andersen
- See Also:
-
Field Summary
FieldsFields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(Declaration dcl) Add a declaration to this list.Find a declaration in this DeclarationListvoid
Utility print method.static DeclarationList
Read and return a DeclarationList object.void
Write a DeclarationList object to a AttributeOutputStream.Methods inherited from class java.util.Vector
add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSize
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, reversed
-
Field Details
-
identifier
Identifier.
-
-
Constructor Details
-
DeclarationList
Create a new DeclarationList.- Parameters:
identifier
- the given identifier
-
-
Method Details
-
find
Find a declaration in this DeclarationList- Parameters:
identifier
- declaration identifier- Returns:
- the resulting Declaration
-
add
Add a declaration to this list.- Specified by:
add
in interfaceCollection<Declaration>
- Specified by:
add
in interfaceList<Declaration>
- Overrides:
add
in classVector<Declaration>
-
print
-
writeObject
Write a DeclarationList object to a AttributeOutputStream.- Parameters:
oupt
- the AttributeOutputStream to write to.- Throws:
IOException
- if something went wrong.
-
readObject
Read and return a DeclarationList object.- Parameters:
inpt
- the AttributeInputStream to read from- Returns:
- the DeclarationList object read from the stream.
- Throws:
IOException
- if something went wrong.
-