edu.umd.cs.jazz.util
Class ZListImpl

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--edu.umd.cs.jazz.util.ZListImpl
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable, ZList
Direct Known Subclasses:
ZListImpl.ZBoundsListImpl, ZListImpl.ZCameraListImpl, ZListImpl.ZLayerGroupListImpl, ZListImpl.ZNodeListImpl, ZListImpl.ZObjectListImpl, ZListImpl.ZPropertyListImpl, ZListImpl.ZSceneGraphObjectListImpl, ZListImpl.ZTransformableListImpl, ZListImpl.ZVisualComponentListImpl, ZNullList

public abstract class ZListImpl
extends java.util.AbstractList
implements ZList, java.io.Serializable

ZListImpl Implementation of ZList. This class is designed to provide a thin wrapper around an array data structure containing objects. In this respect it is similar to java.util.ArrayList. Unlike java.util.ArrayList ZListImpl this class is abstract, and has a subclass for each type of object that we want to store in a ZList. This is done for two reasons. First it allows us to deal with collections of objects without having to cast the objects every time we wish to iterate over them. It also allows subclasses to implement type specific collection methods so that that code is not spread throughout the Jazz framework.

Author:
Jesse Grosjean
See Also:
Serialized Form

Nested Class Summary
static class ZListImpl.ZBoundsListImpl
           
static class ZListImpl.ZCameraListImpl
           
static class ZListImpl.ZLayerGroupListImpl
           
static class ZListImpl.ZNodeListImpl
          For each type of array that we had we should have a subclass that suplies its own element data of that type.
static class ZListImpl.ZObjectListImpl
           
static class ZListImpl.ZPropertyListImpl
           
static class ZListImpl.ZSceneGraphObjectListImpl
           
static class ZListImpl.ZTransformableListImpl
           
static class ZListImpl.ZVisualComponentListImpl
           
 
Nested classes inherited from class edu.umd.cs.jazz.util.ZList
 
Field Summary
static ZNullList NullList
           
protected  int size
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ZListImpl()
           
ZListImpl(int capacity)
           
 
Method Summary
 void add(int index, java.lang.Object element)
           
 boolean add(java.lang.Object o)
           
 boolean addAll(java.util.Collection c)
           
 boolean addAll(int index, java.util.Collection c)
           
 void clear()
           
 java.lang.Object clone()
           
 boolean contains(java.lang.Object elem)
           
abstract  java.lang.Object[] createElementData(int size)
           
 void ensureCapacity(int minCapacity)
           
 java.lang.Object get(int index)
           
abstract  java.lang.Object[] getElementData()
           
 int indexOf(java.lang.Object elem)
           
 boolean isEmpty()
           
 boolean isNull()
           
 int lastIndexOf(java.lang.Object elem)
           
 void moveElementToIndex(java.lang.Object elem, int newIndex)
           
 void pop()
           
 void pop(java.lang.Object element)
           
 java.lang.Object remove(int index)
           
protected  void removeRange(int fromIndex, int toIndex)
           
 boolean replaceWith(java.lang.Object oldElement, java.lang.Object newElement)
           
 java.lang.Object set(int index, java.lang.Object element)
           
abstract  void setElementData(java.lang.Object[] elementData)
           
 void setSize(int aSize)
           
 int size()
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] a)
           
 void trimToSize()
           
 void writeObject(java.lang.String name, ZObjectOutputStream out)
           
 void writeObjectd(java.lang.String name, ZObjectOutputStream out)
           
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, remove, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList
 

Field Detail

NullList

public static ZNullList NullList

size

protected int size
Constructor Detail

ZListImpl

public ZListImpl()

ZListImpl

public ZListImpl(int capacity)
Method Detail

add

public void add(int index,
                java.lang.Object element)
Specified by:
add in interface java.util.List
Overrides:
add in class java.util.AbstractList

add

public boolean add(java.lang.Object o)
Specified by:
add in interface java.util.List
Overrides:
add in class java.util.AbstractList

addAll

public boolean addAll(int index,
                      java.util.Collection c)
Specified by:
addAll in interface java.util.List
Overrides:
addAll in class java.util.AbstractList

addAll

public boolean addAll(java.util.Collection c)
Specified by:
addAll in interface java.util.List
Overrides:
addAll in class java.util.AbstractCollection

clear

public void clear()
Specified by:
clear in interface java.util.List
Overrides:
clear in class java.util.AbstractList

clone

public java.lang.Object clone()
Specified by:
clone in interface ZList
Overrides:
clone in class java.lang.Object

contains

public boolean contains(java.lang.Object elem)
Specified by:
contains in interface java.util.List
Overrides:
contains in class java.util.AbstractCollection

createElementData

public abstract java.lang.Object[] createElementData(int size)

ensureCapacity

public void ensureCapacity(int minCapacity)

get

public java.lang.Object get(int index)
Specified by:
get in interface java.util.List
Specified by:
get in class java.util.AbstractList

getElementData

public abstract java.lang.Object[] getElementData()
Specified by:
getElementData in interface ZList

indexOf

public int indexOf(java.lang.Object elem)
Specified by:
indexOf in interface java.util.List
Overrides:
indexOf in class java.util.AbstractList

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.List
Overrides:
isEmpty in class java.util.AbstractCollection

isNull

public boolean isNull()
Specified by:
isNull in interface ZList

lastIndexOf

public int lastIndexOf(java.lang.Object elem)
Specified by:
lastIndexOf in interface java.util.List
Overrides:
lastIndexOf in class java.util.AbstractList

moveElementToIndex

public void moveElementToIndex(java.lang.Object elem,
                               int newIndex)
Specified by:
moveElementToIndex in interface ZList

pop

public void pop()
Specified by:
pop in interface ZList

pop

public void pop(java.lang.Object element)
Specified by:
pop in interface ZList

remove

public java.lang.Object remove(int index)
Specified by:
remove in interface java.util.List
Overrides:
remove in class java.util.AbstractList

removeRange

protected void removeRange(int fromIndex,
                           int toIndex)
Overrides:
removeRange in class java.util.AbstractList

replaceWith

public boolean replaceWith(java.lang.Object oldElement,
                           java.lang.Object newElement)
Specified by:
replaceWith in interface ZList

set

public java.lang.Object set(int index,
                            java.lang.Object element)
Specified by:
set in interface java.util.List
Overrides:
set in class java.util.AbstractList

setElementData

public abstract void setElementData(java.lang.Object[] elementData)

setSize

public void setSize(int aSize)
Specified by:
setSize in interface ZList

size

public int size()
Specified by:
size in interface java.util.List
Specified by:
size in class java.util.AbstractCollection

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.List
Overrides:
toArray in class java.util.AbstractCollection

toArray

public java.lang.Object[] toArray(java.lang.Object[] a)
Specified by:
toArray in interface java.util.List
Overrides:
toArray in class java.util.AbstractCollection

trimToSize

public void trimToSize()
Specified by:
trimToSize in interface ZList

writeObject

public void writeObject(java.lang.String name,
                        ZObjectOutputStream out)
                 throws java.io.IOException
Specified by:
writeObject in interface ZList
java.io.IOException

writeObjectd

public void writeObjectd(java.lang.String name,
                         ZObjectOutputStream out)
                  throws java.io.IOException
java.io.IOException


Copyright � 2003 by University of Maryland, College Park, MD 20742, USA All rights reserved.