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:
Serializable, Iterable<T>, Collection<T>, List<T>

public abstract class PrismReferenceArrayList<T>
extends AbstractList<T>
implements 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(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(Object o)
           
 boolean removeAll(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 List<T>
Specified by:
get in class AbstractList<T>

size

public int size()
Specified by:
size in interface Collection<T>
Specified by:
size in interface List<T>
Specified by:
size in class 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 List<T>
Overrides:
remove in class AbstractList<T>

removeAll

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

remove

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

add

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

addAll

public boolean addAll(Collection<? extends T> ts)
Specified by:
addAll in interface Collection<T>
Specified by:
addAll in interface List<T>
Overrides:
addAll in class 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 Collection<T>
Specified by:
clear in interface List<T>
Overrides:
clear in class AbstractList<T>

willClear

protected abstract boolean willClear(PrismReferenceValue value)

isEmpty

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


Copyright © 2013 evolveum. All Rights Reserved.