Cytoscape 3.1.1 API

org.cytoscape.work.util
Class AbstractBounded<N extends Comparable<N>>

java.lang.Object
  extended by org.cytoscape.work.util.AbstractBounded<N>
Type Parameters:
N - Any type of Number.
Direct Known Subclasses:
BoundedDouble, BoundedFloat, BoundedInteger, BoundedLong

public abstract class AbstractBounded<N extends Comparable<N>>
extends Object

A bounded number object whose bounds values cannot be modified

Author:
Pasteur

Module: work-api

To use this in your app, include the following dependency in your POM:

<dependency>
    <groupId>org.cytoscape</groupId>
    <artifactId>work-api</artifactId>
</dependency>

Cytoscape Backwards Compatibility (Abstract Class): This class is abstract and meant to be extended by users. This means that we may add methods for minor version updates. Methods will only be removed for major version updates.

Constructor Summary
AbstractBounded(N lower, N initValue, N upper, boolean lowerStrict, boolean upperStrict)
          Creates a new Bounded object.
 
Method Summary
 void addListener(BoundedChangeListener<N> changeListener)
          Adds a listener that will listen for changes to this object
abstract  N clamp(N value)
          Clamps the value of the Bounded object.
 N getLowerBound()
          Returns the lower limit of the object.
 N getUpperBound()
          Returns the upper limit of the object.
 N getValue()
          Returns the value.
 boolean isLowerBoundStrict()
          Does the value have to be strictly greater than the lower bound?
 boolean isUpperBoundStrict()
          Does the value have to be strictly lower than the upper bound?
 void removeListener(BoundedChangeListener<N> changeListener)
          Removes a listener from the list that will listen for changes to this object
 void setBounds(N lower, N upper)
          Set the upper bound (upper) and lower bound (lower) of the Bounded Object.
 void setLowerBoundStrict(boolean lowerStrict)
          Set the lower bound strict policy to lowerStrict.
 void setUpperBoundStrict(boolean upperStrict)
          Set the upper bound strict policy to upperStrict.
 void setValue(N v)
          Set the value v as the value of the Bounded Object.
abstract  void setValue(String s)
          Sets the value of the Bounded object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBounded

public AbstractBounded(N lower,
                       N initValue,
                       N upper,
                       boolean lowerStrict,
                       boolean upperStrict)
Creates a new Bounded object.

Parameters:
lower - The lower bound value.
initValue - The initial value.
upper - The upper bound value.
lowerStrict - True means that the value cannot be equal to the lower bound.
upperStrict - True means that the value cannot be equal to the upper bound.
Method Detail

getUpperBound

public N getUpperBound()
Returns the upper limit of the object.

Returns:
the upper bound.

getLowerBound

public N getLowerBound()
Returns the lower limit of the object.

Returns:
the lower bound.

isUpperBoundStrict

public boolean isUpperBoundStrict()
Does the value have to be strictly lower than the upper bound?

Returns:
true if the upper bound is strict, otherwise false.

isLowerBoundStrict

public boolean isLowerBoundStrict()
Does the value have to be strictly greater than the lower bound?

Returns:
true if the lower bound is strict, otherwise false.

getValue

public N getValue()
Returns the value.

Returns:
the current value of the Bounded object.

setUpperBoundStrict

public void setUpperBoundStrict(boolean upperStrict)
Set the upper bound strict policy to upperStrict.

Parameters:
upperStrict - the upper bound strict policy to be set

setLowerBoundStrict

public void setLowerBoundStrict(boolean lowerStrict)
Set the lower bound strict policy to lowerStrict.

Parameters:
lowerStrict - the lower bound strict policy to be set

setBounds

public void setBounds(N lower,
                      N upper)
Set the upper bound (upper) and lower bound (lower) of the Bounded Object.

Parameters:
lower - the lower bound to be set.
upper - the upper bound to be set.

setValue

public void setValue(N v)
Set the value v as the value of the Bounded Object.

Parameters:
v - the value to be set.

setValue

public abstract void setValue(String s)
Sets the value of the Bounded object.

Parameters:
s - will be converted to the value type of the Bounded object.

clamp

public abstract N clamp(N value)
Clamps the value of the Bounded object.


addListener

public void addListener(BoundedChangeListener<N> changeListener)
Adds a listener that will listen for changes to this object

Parameters:
changeListener - listener object

removeListener

public void removeListener(BoundedChangeListener<N> changeListener)
Removes a listener from the list that will listen for changes to this object

Parameters:
changeListener - listener object

Cytoscape 3.1.1 API

Copyright 2011 Cytoscape Consortium. All rights reserved.