cz.cuni.versatile.api
Interface PreferenceChain

All Superinterfaces:
java.util.Collection, java.util.List
All Known Implementing Classes:
PreferenceChainImpl

public interface PreferenceChain
extends java.util.List

A marker interface to denote an ordered list of values. The reason we are not directly using java.util.List is that we want to distinguish properties whose values are lists (type List), which need to be treated as individuals (i.e. comparing entire lists for equality, etc.) versus the cases when a property of another type (e.g. String) happens to have multiple values in descending order of significance.

In general, a ValueProvider for any Property, regardless of its type, can return PreferenceChain as a collection of multiple values instead of a single value of a given type. The semantics of a property value being a PreferenceChain is equivalent to
if, (else if)[1..(n-1)] sequence, i.e., the values should be tried one after another in the order of the PreferenceChain until a match is found.

Remarks: PreferenceChain corresponds to the RDF:Sequence construct. It is used to let the client to enumerate all acceptable options and also to express its preferences regarding the listed options.

Author:
Jaroslav Gergic

Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray