com.evolveum.midpoint.prism.xjc
Class PrismReferenceArrayList<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<T>
          extended by com.evolveum.midpoint.prism.xjc.PrismReferenceArrayList<T>
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>

public abstract class PrismReferenceArrayList<T>
extends java.util.AbstractList<T>
implements java.io.Serializable

Author:
lazyman TODO: account for concurrent structural modifications using modCount property
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
PrismReferenceArrayList(PrismReference reference)
           
 
Method Summary
 boolean add(T t)
           
 boolean addAll(java.util.Collection<? extends T> ts)
           
 void clear()
          JAXB unmarshaller is calling clear() on lists even though they were just created.
protected abstract  T createItem(PrismReferenceValue value)
           
 T get(int i)
           
protected  PrismReference getReference()
           
protected abstract  PrismReferenceValue getValueFrom(T t)
           
 boolean isEmpty()
           
 T remove(int i)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection<?> objects)
           
 int size()
           
protected abstract  boolean willClear(PrismReferenceValue value)
           
 
Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
contains, containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
contains, containsAll, retainAll, toArray, toArray
 

Constructor Detail

PrismReferenceArrayList

public PrismReferenceArrayList(PrismReference reference)
Method Detail

getReference

protected PrismReference getReference()

get

public T get(int i)
Specified by:
get in interface java.util.List<T>
Specified by:
get in class java.util.AbstractList<T>

size

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

createItem

protected abstract T createItem(PrismReferenceValue value)

getValueFrom

protected abstract PrismReferenceValue getValueFrom(T t)

remove

public T remove(int i)
Specified by:
remove in interface java.util.List<T>
Overrides:
remove in class java.util.AbstractList<T>

removeAll

public boolean removeAll(java.util.Collection<?> objects)
Specified by:
removeAll in interface java.util.Collection<T>
Specified by:
removeAll in interface java.util.List<T>
Overrides:
removeAll in class java.util.AbstractCollection<T>

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection<T>
Specified by:
remove in interface java.util.List<T>
Overrides:
remove in class java.util.AbstractCollection<T>

add

public boolean add(T t)
Specified by:
add in interface java.util.Collection<T>
Specified by:
add in interface java.util.List<T>
Overrides:
add in class java.util.AbstractList<T>

addAll

public boolean addAll(java.util.Collection<? extends T> ts)
Specified by:
addAll in interface java.util.Collection<T>
Specified by:
addAll in interface java.util.List<T>
Overrides:
addAll in class java.util.AbstractCollection<T>

clear

public void clear()
JAXB unmarshaller is calling clear() on lists even though they were just created. As the references should be visible as two JAXB fields, clearing one of them will also clear the other. Therefore we need this hack. Calling clear() will only clear the values that naturally "belong" to the list.

Specified by:
clear in interface java.util.Collection<T>
Specified by:
clear in interface java.util.List<T>
Overrides:
clear in class java.util.AbstractList<T>

willClear

protected abstract boolean willClear(PrismReferenceValue value)

isEmpty

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


Copyright © 2012 evolveum. All Rights Reserved.