org.ow2.weblab.rdf
Class Value<T>

java.lang.Object
  extended by org.ow2.weblab.rdf.Value<T>
Type Parameters:
T - the type of the object value.
All Implemented Interfaces:
java.lang.Iterable<T>

public class Value<T>
extends java.lang.Object
implements java.lang.Iterable<T>

This class simulate several behaviours:


Field Summary
protected  java.util.Map<java.lang.String,T> byLang
           
protected  java.util.LinkedList<T> list
           
 
Constructor Summary
protected Value()
          If you have rational to grant a public access to the constructor please, explain it at forum.weblab-project.org
protected Value(T item)
          If you have rational to grant a public access to the constructor please, explain it at forum.weblab-project.org
 
Method Summary
protected  void addItem(T item, java.lang.String lang)
          If you have rational to give a grant access to this method please, explain it at forum.weblab-project.org
 T firstTypedValue()
          Returns the first typed value.
 T firstTypedValue(java.lang.String lang)
          Returns the first typed value that is defined this the language attribute.
 java.util.LinkedList<T> getValues()
          Returns a list of typed values.
 boolean hasValue()
          Returns true if this object contains at least one typed value
 java.util.Iterator<T> iterator()
           
 int size()
          Returns the number of typed values available
 java.lang.String toString()
          Returns the toString() method result on the first typed value or null if there is not value available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

list

protected final java.util.LinkedList<T> list

byLang

protected final java.util.Map<java.lang.String,T> byLang
Constructor Detail

Value

protected Value()
If you have rational to grant a public access to the constructor please, explain it at forum.weblab-project.org


Value

protected Value(T item)
If you have rational to grant a public access to the constructor please, explain it at forum.weblab-project.org

Method Detail

addItem

protected void addItem(T item,
                       java.lang.String lang)
If you have rational to give a grant access to this method please, explain it at forum.weblab-project.org


getValues

public java.util.LinkedList<T> getValues()
Returns a list of typed values. One can note that the association of typed values with language attributes will be lost for the returned list.

Returns:
a list of typed values

hasValue

public boolean hasValue()
Returns true if this object contains at least one typed value

Returns:
true if this object contains at least one typed value else false

firstTypedValue

public T firstTypedValue()
Returns the first typed value.

Returns:
the first typed value or null if there is no value

firstTypedValue

public T firstTypedValue(java.lang.String lang)
Returns the first typed value that is defined this the language attribute.

Returns:
the first typed value that is defined this the language attribute or null if there is no value.

size

public int size()
Returns the number of typed values available

Returns:
the number of typed values available

toString

public java.lang.String toString()
Returns the toString() method result on the first typed value or null if there is not value available.

Overrides:
toString in class java.lang.Object
Returns:
the toString() method result on the first typed value or null if there is not value available.

iterator

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


Copyright © 2004-2010. All Rights Reserved.