info.sswap.http.representation
Class Property

java.lang.Object
  extended by info.sswap.http.representation.Property

public class Property
extends java.lang.Object

Represents a property for an entity (along with the value). If an entity has multiple properties with the same name, it has multiple Property objects.

Author:
Blazej Bulka

Field Summary
private  int maxCardinality
          The maximum cardinality restriction for this property.
private  int minCardinality
          The minimum cardinality restriction for this property.
private  java.lang.String name
          The name of the property (URI)
private  Value value
          The value for this property.
 
Constructor Summary
Property(java.lang.String name)
          Creates a property with a specified name, no value, and default cardinality restrictions.
Property(java.lang.String name, int minCardinality, int maxCardinality, Value value)
          Creates a property with specified name, value, and cardinality restrictions
Property(java.lang.String name, Value value)
          Creates a property with a specified name and value, and default cardinality restrictions.
 
Method Summary
 int getMaxCardinality()
          Returns the maximum cardinality of the property.
 int getMinCardinality()
          Gets the minimum cardinality of the property
 java.lang.String getName()
          Gets the name of the property (URI)
 Value getValue()
          Gets the value of the property
 void setMaxCardinality(int maxCardinality)
          Sets the maximum cardinality of the property
 void setMinCardinality(int minCardinality)
          Sets the minimum cardinality of the property
 void setName(java.lang.String name)
          Sets the name of the property
 void setValue(Value value)
          Sets the value of the property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

private java.lang.String name
The name of the property (URI)


minCardinality

private int minCardinality
The minimum cardinality restriction for this property. Must be a non-negative integer.


maxCardinality

private int maxCardinality
The maximum cardinality restriction for this property. Must be a non-negative integer, and the unbounded maximum cardinality is denoted by Integer.MAX_VALUE.


value

private Value value
The value for this property. May be null, if the property has no value (as it happens e.g., in RDGs).

Constructor Detail

Property

public Property(java.lang.String name)
Creates a property with a specified name, no value, and default cardinality restrictions.

Parameters:
name - the name of the property (URI)

Property

public Property(java.lang.String name,
                Value value)
Creates a property with a specified name and value, and default cardinality restrictions.

Parameters:
name - the name of the property (URI)
value - the value for the property (may be null)

Property

public Property(java.lang.String name,
                int minCardinality,
                int maxCardinality,
                Value value)
Creates a property with specified name, value, and cardinality restrictions

Parameters:
name - the name of the property (URI)
minCardinality - minimum cardinality restriction. Must be a non-negative integer.
maxCardinality - maximum cardinality restriction. Must be a non-negative integer. For unbounded maximum cardinality restriction, use Integer.MAX_VALUE.
value - the value of the property (may be null)
Method Detail

getName

public java.lang.String getName()
Gets the name of the property (URI)

Returns:
the name of the property

setName

public void setName(java.lang.String name)
Sets the name of the property

Parameters:
name - the name to set (URI)

getMinCardinality

public int getMinCardinality()
Gets the minimum cardinality of the property

Returns:
the minimum cardinality of the property

setMinCardinality

public void setMinCardinality(int minCardinality)
Sets the minimum cardinality of the property

Parameters:
minCardinality - the minimum cardinality to set

getMaxCardinality

public int getMaxCardinality()
Returns the maximum cardinality of the property. For unbounded maximum cardinalities, Integer.MAX_VALUE is returned

Returns:
the maximum cardinality of the property (Integer.MAX_VALUE for maximum cardinality)

setMaxCardinality

public void setMaxCardinality(int maxCardinality)
Sets the maximum cardinality of the property

Parameters:
maxCardinality - the maximum cardinality of the property

getValue

public Value getValue()
Gets the value of the property

Returns:
the value of the property or null, if there is no value

setValue

public void setValue(Value value)
Sets the value of the property

Parameters:
value - the value to set or null, if there is no value


Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin.