OBEROn SDK

com.oberon.ooql.sdk
Class FieldRange

java.lang.Object
  extended by com.oberon.ooql.sdk.OBBase
      extended by com.oberon.ooql.sdk.AdminComponent
          extended by com.oberon.ooql.sdk.FieldRange
All Implemented Interfaces:
java.io.Serializable

public class FieldRange
extends AdminComponent
implements java.io.Serializable

Defines valid values/intervals (ranges) for Field objects.

Version:
5.0
See Also:
Serialized Form

Field Summary
static int CLOSED
          Includes all values included in a interval; includes also both the margins
static int EQUAL
          Specifies a single value
static int GREAT
          Includes all values greater than a given value
static int GREAT_EQUAL
          Includes all values greater or equal of a given value
static int LEFT_OPENED
          Includes all values included in a interval; excludes the left margin
static int LESS
          Includes all values less than a given value
static int LESS_EQUAL
          Includes all values less or equal of a given value
static int NOT_EQUAL
          Exclude a single value
static int OPENED
          Includes all values included in a interval; excludes both the margins
static int RIGHT_OPENED
          Includes all values included in a interval; excludes the right margin
 
Fields inherited from class com.oberon.ooql.sdk.AdminComponent
bsOptions
 
Constructor Summary
FieldRange()
           
FieldRange(int rangeType, java.lang.String value)
          Create a new simple range
FieldRange(int rangeType, java.lang.String leftValue, java.lang.String rightValue)
          Create a new interval range
FieldRange(java.lang.String composedRange)
          Create a new range using a composed string
 
Method Summary
 boolean equals(FieldRange range)
          Check if a given range is equal to this range
 void fromXML(org.jdom.Element rootElement)
          Load the range from XML element tree
 java.lang.String getCreateCommand(boolean force)
          [Inherited but not used]
 java.lang.String getLeftValue()
          Return the left (low) or the reference value for simple ranges
 java.lang.String getProperty(java.lang.String propertyName, java.util.Vector<java.lang.Object> filterArgs, java.lang.String sToken, Framework framework)
          [inherited but NOT USED]
 int getRangeType()
          Return the range type
 java.lang.String getRangeTypeAsString()
          Return the range type as String
 java.lang.String getRightValue()
          Return the right (high) value
 java.lang.String getSaveCommand(boolean force)
          [Inherited but not used]
 java.util.Vector<?> getTargetNames(java.lang.String composedName, java.util.Vector<java.lang.Object> filterArgs, Framework framework)
          [inherited but NOT USED]
static int getTypeFromString(java.lang.String rangeType)
          Convert the range type from a String to the internal value
static int indexOf(java.util.Vector<FieldRange> ranges, FieldRange searchRange)
          Check if a range is included in a range Vector.
 boolean isInterval()
          Check if the range is an interval range (otherwise it is a simple range)
 boolean isValidValue(java.lang.String value)
          Check if a value is compatible with this range
 void setRange(int rangeType, java.lang.String value)
          Set a new simple range
 void setRange(int rangeType, java.lang.String leftValue, java.lang.String rightValue)
          Set a new interval range
 java.lang.String toString()
          Return the FieldRange as a single String
 java.lang.String toString(boolean isString)
          Return the FieldRange as a single String
 org.jdom.Element toXML(boolean getImage, boolean fullDump, Framework framework)
          Return the range as XML element tree
 org.jdom.Element toXML(Framework framework)
          Return the range as XML element tree
 
Methods inherited from class com.oberon.ooql.sdk.AdminComponent
checkChangeName, getAdminType, getCommonProperty, getCommonTargetNames, getCrtDate, getDescription, getEditBasicCommand, getImage, getImageData, getImageFile, getModDate, getModUser, getName, getOldName, hasImage, setCrtDate, setDescription, setImage, setImageData, setImageFile, setModDate, setModUser, setName, toCommonXML, toXML
 
Methods inherited from class com.oberon.ooql.sdk.OBBase
addChange, addUniqueChange, ChangesFromXML, ChangesToXML, getChanges, getChangesAsString, getId, isLinked, removeChange, resetChanges, setId, setLinked
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EQUAL

public static final int EQUAL
Specifies a single value

See Also:
Constant Field Values

NOT_EQUAL

public static final int NOT_EQUAL
Exclude a single value

See Also:
Constant Field Values

LESS

public static final int LESS
Includes all values less than a given value

See Also:
Constant Field Values

GREAT

public static final int GREAT
Includes all values greater than a given value

See Also:
Constant Field Values

LESS_EQUAL

public static final int LESS_EQUAL
Includes all values less or equal of a given value

See Also:
Constant Field Values

GREAT_EQUAL

public static final int GREAT_EQUAL
Includes all values greater or equal of a given value

See Also:
Constant Field Values

CLOSED

public static final int CLOSED
Includes all values included in a interval; includes also both the margins

See Also:
Constant Field Values

LEFT_OPENED

public static final int LEFT_OPENED
Includes all values included in a interval; excludes the left margin

See Also:
Constant Field Values

RIGHT_OPENED

public static final int RIGHT_OPENED
Includes all values included in a interval; excludes the right margin

See Also:
Constant Field Values

OPENED

public static final int OPENED
Includes all values included in a interval; excludes both the margins

See Also:
Constant Field Values
Constructor Detail

FieldRange

public FieldRange()

FieldRange

public FieldRange(int rangeType,
                  java.lang.String leftValue,
                  java.lang.String rightValue)
Create a new interval range

Parameters:
rangeType - the interval type ( CLOSED , LEFT_OPENED , RIGHT_OPENED , OPENED )
leftValue - the left or low value
rightValue - the right or high value

FieldRange

public FieldRange(int rangeType,
                  java.lang.String value)
Create a new simple range

Parameters:
rangeType - the range type ( EQUAL , NOT_EQUAL , LESS , GREAT , LESS_EQUAL , GREAT_EQUAL )
value - the reference value

FieldRange

public FieldRange(java.lang.String composedRange)
Create a new range using a composed string

Parameters:
composedRange - the range in format: <type>|<leftvalue>|<rightvalue>
Method Detail

setRange

public void setRange(int rangeType,
                     java.lang.String leftValue,
                     java.lang.String rightValue)
Set a new interval range

Parameters:
rangeType - the interval type ( CLOSED , LEFT_OPENED , RIGHT_OPENED , OPENED )
leftValue - the left or low value
rightValue - the right or high value

setRange

public void setRange(int rangeType,
                     java.lang.String value)
Set a new simple range

Parameters:
rangeType - the range type ( EQUAL , NOT_EQUAL , LESS , GREAT , LESS_EQUAL , GREAT_EQUAL )
value - the reference value

getRangeType

public int getRangeType()
Return the range type


getRangeTypeAsString

public java.lang.String getRangeTypeAsString()
Return the range type as String


getTypeFromString

public static int getTypeFromString(java.lang.String rangeType)
Convert the range type from a String to the internal value


getLeftValue

public java.lang.String getLeftValue()
Return the left (low) or the reference value for simple ranges


getRightValue

public java.lang.String getRightValue()
Return the right (high) value


isInterval

public boolean isInterval()
Check if the range is an interval range (otherwise it is a simple range)


isValidValue

public boolean isValidValue(java.lang.String value)
Check if a value is compatible with this range

Parameters:
value - the value to test

equals

public boolean equals(FieldRange range)
Check if a given range is equal to this range

Parameters:
range - the range to test

indexOf

public static int indexOf(java.util.Vector<FieldRange> ranges,
                          FieldRange searchRange)
Check if a range is included in a range Vector.

Parameters:
ranges - a vector of FieldRanges
searchRange - the range to search
Returns:
the vector index if found or the value -1 otherwise.

getProperty

public java.lang.String getProperty(java.lang.String propertyName,
                                    java.util.Vector<java.lang.Object> filterArgs,
                                    java.lang.String sToken,
                                    Framework framework)
[inherited but NOT USED]

Specified by:
getProperty in class OBBase

getTargetNames

public java.util.Vector<?> getTargetNames(java.lang.String composedName,
                                          java.util.Vector<java.lang.Object> filterArgs,
                                          Framework framework)
[inherited but NOT USED]

Specified by:
getTargetNames in class OBBase

toString

public java.lang.String toString()
Return the FieldRange as a single String

Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(boolean isString)
Return the FieldRange as a single String

Parameters:
isString - if true convert the range values as single quoted strings

toXML

public org.jdom.Element toXML(Framework framework)
Return the range as XML element tree

Parameters:
framework - the current framework

toXML

public org.jdom.Element toXML(boolean getImage,
                              boolean fullDump,
                              Framework framework)
Return the range as XML element tree

See Also:
toXML(Framework)

fromXML

public void fromXML(org.jdom.Element rootElement)
Load the range from XML element tree

Overrides:
fromXML in class AdminComponent

getCreateCommand

public java.lang.String getCreateCommand(boolean force)
[Inherited but not used]


getSaveCommand

public java.lang.String getSaveCommand(boolean force)
[Inherited but not used]


OBEROn SDK

Copyright © 2008-2014 Mirko Solazzi. All Rights Reserved.