org.openanzo.glitter.query
Class SolutionList

java.lang.Object
  extended by org.openanzo.glitter.query.SolutionList
All Implemented Interfaces:
java.lang.Iterable<PatternSolution>, java.util.Collection<PatternSolution>, java.util.List<PatternSolution>, SolutionSet

public class SolutionList
extends java.lang.Object
implements SolutionSet

An implementation of SolutionSet using an ArrayList of PatternSolutions.

Author:
lee

Constructor Summary
SolutionList()
          Constructs a solution set with no solutions.
SolutionList(java.util.List<PatternSolution> solutions)
          Clones the given list of solutions.
 
Method Summary
 void add(int index, PatternSolution element)
           
 boolean add(PatternSolution o)
           
 boolean addAll(java.util.Collection<? extends PatternSolution> c)
           
 boolean addAll(int index, java.util.Collection<? extends PatternSolution> c)
           
 void clear()
           
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection<?> c)
           
 boolean equals(java.lang.Object o)
           
 PatternSolution get(int index)
           
 int hashCode()
           
 int indexOf(java.lang.Object o)
           
 boolean isEmpty()
           
 java.util.Iterator<PatternSolution> iterator()
           
 int lastIndexOf(java.lang.Object o)
           
 java.util.ListIterator<PatternSolution> listIterator()
           
 java.util.ListIterator<PatternSolution> listIterator(int index)
           
 PatternSolution remove(int index)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection<?> c)
           
 boolean retainAll(java.util.Collection<?> c)
           
 PatternSolution set(int index, PatternSolution element)
           
 int size()
           
 SolutionSet slice(int startInclusive, int endExclusive)
          Returns a selected range of solutions from the SolutionSet
 java.util.List<PatternSolution> subList(int fromIndex, int toIndex)
           
 java.lang.Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SolutionList

public SolutionList()
Constructs a solution set with no solutions.


SolutionList

public SolutionList(java.util.List<PatternSolution> solutions)
Clones the given list of solutions.

Parameters:
solutions -
Method Detail

slice

public SolutionSet slice(int startInclusive,
                         int endExclusive)
Description copied from interface: SolutionSet
Returns a selected range of solutions from the SolutionSet

Specified by:
slice in interface SolutionSet
Parameters:
startInclusive - The returned range starts at the given index (zero-indexed).
endExclusive - The returned range contains all of the solutions before endExclusive
Returns:
A sliced solution set

add

public void add(int index,
                PatternSolution element)
Specified by:
add in interface java.util.List<PatternSolution>

add

public boolean add(PatternSolution o)
Specified by:
add in interface java.util.Collection<PatternSolution>
Specified by:
add in interface java.util.List<PatternSolution>

addAll

public boolean addAll(java.util.Collection<? extends PatternSolution> c)
Specified by:
addAll in interface java.util.Collection<PatternSolution>
Specified by:
addAll in interface java.util.List<PatternSolution>

addAll

public boolean addAll(int index,
                      java.util.Collection<? extends PatternSolution> c)
Specified by:
addAll in interface java.util.List<PatternSolution>

clear

public void clear()
Specified by:
clear in interface java.util.Collection<PatternSolution>
Specified by:
clear in interface java.util.List<PatternSolution>

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Collection<PatternSolution>
Specified by:
contains in interface java.util.List<PatternSolution>

containsAll

public boolean containsAll(java.util.Collection<?> c)
Specified by:
containsAll in interface java.util.Collection<PatternSolution>
Specified by:
containsAll in interface java.util.List<PatternSolution>

equals

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

get

public PatternSolution get(int index)
Specified by:
get in interface java.util.List<PatternSolution>

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Collection<PatternSolution>
Specified by:
hashCode in interface java.util.List<PatternSolution>
Overrides:
hashCode in class java.lang.Object

indexOf

public int indexOf(java.lang.Object o)
Specified by:
indexOf in interface java.util.List<PatternSolution>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection<PatternSolution>
Specified by:
isEmpty in interface java.util.List<PatternSolution>

iterator

public java.util.Iterator<PatternSolution> iterator()
Specified by:
iterator in interface java.lang.Iterable<PatternSolution>
Specified by:
iterator in interface java.util.Collection<PatternSolution>
Specified by:
iterator in interface java.util.List<PatternSolution>

lastIndexOf

public int lastIndexOf(java.lang.Object o)
Specified by:
lastIndexOf in interface java.util.List<PatternSolution>

listIterator

public java.util.ListIterator<PatternSolution> listIterator()
Specified by:
listIterator in interface java.util.List<PatternSolution>

listIterator

public java.util.ListIterator<PatternSolution> listIterator(int index)
Specified by:
listIterator in interface java.util.List<PatternSolution>

remove

public PatternSolution remove(int index)
Specified by:
remove in interface java.util.List<PatternSolution>

remove

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

removeAll

public boolean removeAll(java.util.Collection<?> c)
Specified by:
removeAll in interface java.util.Collection<PatternSolution>
Specified by:
removeAll in interface java.util.List<PatternSolution>

retainAll

public boolean retainAll(java.util.Collection<?> c)
Specified by:
retainAll in interface java.util.Collection<PatternSolution>
Specified by:
retainAll in interface java.util.List<PatternSolution>

set

public PatternSolution set(int index,
                           PatternSolution element)
Specified by:
set in interface java.util.List<PatternSolution>

size

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

subList

public java.util.List<PatternSolution> subList(int fromIndex,
                                               int toIndex)
Specified by:
subList in interface java.util.List<PatternSolution>

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection<PatternSolution>
Specified by:
toArray in interface java.util.List<PatternSolution>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface java.util.Collection<PatternSolution>
Specified by:
toArray in interface java.util.List<PatternSolution>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.