org.cip4.jdflib.datatypes
Class JDFTransferFunction

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector<Object>
              extended by org.cip4.jdflib.datatypes.JDFNumList
                  extended by org.cip4.jdflib.datatypes.JDFTransferFunction
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Object>, Collection<Object>, List<Object>, RandomAccess, JDFBaseDataTypes

public class JDFTransferFunction
extends JDFNumList

This class is a representation of a whitespace separated list of numbers representing a set of XY coordinates of a transfer function. The total number of x y values must be even because of the pairs.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.cip4.jdflib.datatypes.JDFBaseDataTypes
JDFBaseDataTypes.EnumFitsValue
 
Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Fields inherited from interface org.cip4.jdflib.datatypes.JDFBaseDataTypes
EPSILON, MAX_CMYK_COLOR, MAX_LAB_COLOR, MAX_MATRIX_DIMENSION, MAX_RECTANGLE_DIMENSION, MAX_RGB_COLOR, MAX_SHAPE_DIMENSION, MAX_XY_DIMENSION
 
Constructor Summary
JDFTransferFunction()
          constructs a xy pair with all values set to 0.0 Double
JDFTransferFunction(JDFNumList nl)
          constructs a number list with the given number list
JDFTransferFunction(JDFTransferFunction tf)
          copy constructor
constructs a number list with the given transfer function
JDFTransferFunction(String s)
          constructs a number list with the given string the number of tokens must be even
JDFTransferFunction(Vector v)
          Deprecated. use typesafe constructors
 
Method Summary
 void add(double x, double y)
          add - adds a x and a y coordinate to the vector
 void add(Double x, Double y)
          add - adds a x and a y coordinate to the vector
 void add(JDFTransferFunction tf)
          add - adds a complete transfer function to the vector
 void add(JDFXYPair xy)
          add - adds a xy coordinate to the vector
 void add(String s)
          add - adds a x and a y coordinate to the vector
static JDFTransferFunction createTransferFunction(String s)
          factory for JDFTransferFunction that silently returns null in case of illegal strings
 boolean isValid()
          isValid - true if the size of the vector is even and all instances are Double types
 
Methods inherited from class org.cip4.jdflib.datatypes.JDFNumList
abs, clone, contains, containsAll, copyNumList, doubleAt, elementAt, equals, getDoubleList, getIntArray, getString, getString, hashCode, isValidString, matches, removeElementAt, replaceElementAt, scale, scaleFromCM, scaleFromMM, scaleToCM, scaleToMM, set, setString, subtract, toString, unify
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elements, ensureCapacity, firstElement, get, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

JDFTransferFunction

public JDFTransferFunction()
                    throws DataFormatException
constructs a xy pair with all values set to 0.0 Double

Throws:
DataFormatException - - if the String has not a valid format

JDFTransferFunction

public JDFTransferFunction(String s)
                    throws DataFormatException
constructs a number list with the given string the number of tokens must be even

Parameters:
s - the given String in number list format
Throws:
DataFormatException - - if the String has not a valid format

JDFTransferFunction

@Deprecated
public JDFTransferFunction(Vector v)
                    throws DataFormatException
Deprecated. use typesafe constructors

constructs a number list with the given vector the number of elements must be even

Parameters:
v - the number list as a vector
Throws:
DataFormatException - - if the Vector has not a valid format

JDFTransferFunction

public JDFTransferFunction(JDFNumList nl)
                    throws DataFormatException
constructs a number list with the given number list

Parameters:
nl - the given number list
Throws:
DataFormatException - - if the String has not a valid format

JDFTransferFunction

public JDFTransferFunction(JDFTransferFunction tf)
copy constructor
constructs a number list with the given transfer function

Parameters:
tf - the given number list
Throws:
DataFormatException - - if the String has not a valid format
Method Detail

createTransferFunction

public static JDFTransferFunction createTransferFunction(String s)
factory for JDFTransferFunction that silently returns null in case of illegal strings

Parameters:
s - the string to parse
Returns:
the JDFTransferFunction, null if s is not compatible

isValid

public boolean isValid()
                throws DataFormatException
isValid - true if the size of the vector is even and all instances are Double types

Specified by:
isValid in class JDFNumList
Returns:
boolean - true if all instances are Double or Integer types
Throws:
DataFormatException - - if the Vector has not a valid format

add

public void add(JDFXYPair xy)
add - adds a xy coordinate to the vector

Parameters:
xy - the xy coordinate to add

add

public void add(Double x,
                Double y)
add - adds a x and a y coordinate to the vector

Parameters:
x - the x coordinate to add
y - the y coordinate to add

add

public void add(double x,
                double y)
add - adds a x and a y coordinate to the vector

Parameters:
x - the x coordinate to add
y - the y coordinate to add

add

public void add(String s)
         throws DataFormatException
add - adds a x and a y coordinate to the vector

Parameters:
s - a string with the x and y coordinate to add
Throws:
DataFormatException - - if the String has not a valid format

add

public void add(JDFTransferFunction tf)
add - adds a complete transfer function to the vector

Parameters:
tf - the given transfer function to add


Copyright © 2013. All Rights Reserved.