java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
com.hp.hpl.jena.graph.query.Domain
- All Implemented Interfaces:
- java.util.Collection, IndexValues, java.lang.Iterable, java.util.List
- public class Domain
- extends java.util.AbstractList
- implements IndexValues
A Domain is an answer to a Binding query. It satisfies the List
interface so that casual users don't have to worry about its special
features - for them, it is immutable (they only ever get to see Domains
that have emerged from the query process).
| Methods inherited from class java.util.AbstractList |
add, add, addAll, clear, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
value
private com.hp.hpl.jena.graph.Node[] value
- The array holding the bound values.
Domain
public Domain(com.hp.hpl.jena.graph.Node[] value)
- Initialise a Domain with a copy of a Node value array.
Domain
public Domain(int size)
size
public int size()
- Description copied from interface:
java.util.List
- Get the number of elements in this list. If the list contains more
than Integer.MAX_VALUE elements, return Integer.MAX_VALUE.
- Specified by:
size in interface java.util.List
get
public java.lang.Object get(int i)
- Description copied from interface:
IndexValues
- Answer the value at
index.
- Specified by:
get in interface IndexValues
setElement
public void setElement(int i,
com.hp.hpl.jena.graph.Node x)
copy
public Domain copy()
equals
public boolean equals(java.lang.Object x)
- Description copied from class:
java.util.AbstractList
- Test whether this list is equal to another object. A List is defined to be
equal to an object if and only if that object is also a List, and the two
lists have the same sequence. Two lists l1 and l2 are equal if and only
if
l1.size() == l2.size(), and for every integer n between 0
and l1.size() - 1 inclusive, l1.get(n) == null ?
l2.get(n) == null : l1.get(n).equals(l2.get(n)).
This implementation returns true if the object is this, or false if the
object is not a List. Otherwise, it iterates over both lists (with
iterator()), returning false if two elements compare false or one list
is shorter, and true if the iteration completes successfully.
- Specified by:
equals in interface java.util.List
toString
public java.lang.String toString()
- Description copied from class:
java.util.AbstractCollection
- Creates a String representation of the Collection. The string returned is
of the form "[a, b, ...]" where a and b etc are the results of calling
toString on the elements of the collection. This implementation obtains an
Iterator over the Collection and adds each element to a StringBuffer as it
is returned by the iterator. "" is inserted when the collection
contains itself (only works for direct containment, not for collections
inside collections).