org.nees.repo.chef
Class DisplayRelationValue

java.lang.Object
  extended byorg.nees.repo.chef.DisplayRelationValue

public class DisplayRelationValue
extends java.lang.Object

Represents a Relation's value; either String or Reference. A DisplayRelation acts as a container of zero or more DisplayRelationValues.

Typical Usage:

A DisplayRelationValue is acquired by interrogating a DisplayRelation's getValue() or getValues() methods. Then, getString() or getReference..() can be called to retrieve information about the value. The type of a DisplayRelationValue can be determined by calling the parent DisplayRelation's getType() method.

Life Cycle:

Created by DisplayRelation; lives in DisplayRelations read-only value() and values() properties.

See Also:
DisplayRelation

Constructor Summary
protected DisplayRelationValue(java.util.Date s)
          creates displayrelation given a Date
protected DisplayRelationValue(double s)
          creates displayrelation given a double
protected DisplayRelationValue(Identifier r, MetadataObject refObj, java.lang.String t)
          creates displayrelation given a reference, it's title
protected DisplayRelationValue(int s)
          creates displayrelation given an int
protected DisplayRelationValue(long s)
          creates displayrelation given a long
protected DisplayRelationValue(java.lang.String s)
          creates displayrelation given a string
 
Method Summary
 java.util.Date getDate()
          Get the date value.
 java.lang.String getDay()
          Get the day of a date
 double getDouble()
          Get the double value.
 java.lang.String getHour()
          Get the hour of a date
 int getInt()
          Get the int value.
 long getLong()
          Get the long value.
 java.lang.String getMilliSec()
          Get the millisec of a date
 java.lang.String getMin()
          Get the min of a date
 java.lang.String getMonth()
          Get the month of a date
 int getPosition()
           
 Identifier getReference()
          Get the reference value.
 Identifier getReferenceId()
          Get the reference's ID, serialized.
 java.lang.String getReferenceIdSerialized()
          Get the reference's ID, serialized.
 java.lang.String getReferenceTitle()
          Get the title of the referenced object.
 int getReferenceVersion()
          Get the reference's version #.
 java.lang.String getReferenceVersionAsString()
          Get the reference's version # as a String.
 java.lang.String getSec()
          Get the Sec of a date
 java.lang.String getString()
          Get the String value.
static java.lang.String getString(java.util.Date value)
          Convenience method for returning the string representation of a Date.
static java.lang.String getString(double value)
          Convenience method for returning the string representation of a double.
static java.lang.String getString(Identifier value)
          Convenience method for returning the string representation of a reference.
static java.lang.String getString(int value)
          Convenience method for returning the string representation of an int.
static java.lang.String getString(long value)
          Convenience method for returning the string representation of a long.
static java.lang.String getString(java.lang.String value)
          Convenience method for returning the string representation of a String.
 java.lang.String getYear()
          Get the year of a date
 void setPosition(int i)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayRelationValue

protected DisplayRelationValue(java.lang.String s)
creates displayrelation given a string


DisplayRelationValue

protected DisplayRelationValue(int s)
creates displayrelation given an int


DisplayRelationValue

protected DisplayRelationValue(long s)
creates displayrelation given a long


DisplayRelationValue

protected DisplayRelationValue(double s)
creates displayrelation given a double


DisplayRelationValue

protected DisplayRelationValue(java.util.Date s)
creates displayrelation given a Date


DisplayRelationValue

protected DisplayRelationValue(Identifier r,
                               MetadataObject refObj,
                               java.lang.String t)
creates displayrelation given a reference, it's title

Method Detail

setPosition

public void setPosition(int i)

getPosition

public int getPosition()

getString

public java.lang.String getString()
Get the String value.

Returns:
String

getString

public static java.lang.String getString(java.lang.String value)
Convenience method for returning the string representation of a String. (For completeness, and to allow use in a place where the type isn't a priori known, such as in a Velocity template.)


getString

public static java.lang.String getString(Identifier value)
Convenience method for returning the string representation of a reference.


getString

public static java.lang.String getString(double value)
Convenience method for returning the string representation of a double.


getString

public static java.lang.String getString(int value)
Convenience method for returning the string representation of an int.


getString

public static java.lang.String getString(long value)
Convenience method for returning the string representation of a long.


getString

public static java.lang.String getString(java.util.Date value)
Convenience method for returning the string representation of a Date.


getInt

public int getInt()
Get the int value.

Returns:
int

getLong

public long getLong()
Get the long value. return long


getDouble

public double getDouble()
Get the double value.

Returns:
double

getDate

public java.util.Date getDate()
Get the date value.

Returns:
java.util.Date

getDay

public java.lang.String getDay()
Get the day of a date

Returns:
day as string

getMonth

public java.lang.String getMonth()
Get the month of a date

Returns:
month as String

getYear

public java.lang.String getYear()
Get the year of a date

Returns:
year as String

getHour

public java.lang.String getHour()
Get the hour of a date

Returns:
hour as String

getMin

public java.lang.String getMin()
Get the min of a date

Returns:
min as String

getSec

public java.lang.String getSec()
Get the Sec of a date

Returns:
sec as String

getMilliSec

public java.lang.String getMilliSec()
Get the millisec of a date

Returns:
millisec as String

getReference

public Identifier getReference()
Get the reference value.

Returns:
reference

getReferenceIdSerialized

public java.lang.String getReferenceIdSerialized()
Get the reference's ID, serialized. For convenience.

Returns:
id of reference as String

getReferenceId

public Identifier getReferenceId()
Get the reference's ID, serialized. For convenience.

Returns:
id of reference as String

getReferenceVersion

public int getReferenceVersion()
Get the reference's version #. For convenience.

Returns:
version as int

getReferenceTitle

public java.lang.String getReferenceTitle()
Get the title of the referenced object.

Returns:
title of reference

getReferenceVersionAsString

public java.lang.String getReferenceVersionAsString()
Get the reference's version # as a String.

Returns:
version as String