Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.hp.hpl.jena.graph.query
Class Domain  view Domain download Domain.java

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended bycom.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).


Nested Class Summary
 
Nested classes inherited from class java.util.AbstractList
 
Field Summary
private  com.hp.hpl.jena.graph.Node[] value
          The array holding the bound values.
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Domain(int size)
           
Domain(com.hp.hpl.jena.graph.Node[] value)
          Initialise a Domain with a copy of a Node value array.
 
Method Summary
 Domain copy()
           
 boolean equals(java.lang.Object x)
          Test whether this list is equal to another object.
 java.lang.Object get(int i)
          Answer the value at index.
 void setElement(int i, com.hp.hpl.jena.graph.Node x)
           
 int size()
          Get the number of elements in this list.
 java.lang.String toString()
          Creates a String representation of the Collection.
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Field Detail

value

private com.hp.hpl.jena.graph.Node[] value
The array holding the bound values.

Constructor Detail

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)
Method Detail

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).