hep.aida.ref.histogram
Class DataPointSet
- java.lang.Object
-
- hep.aida.ref.event.AIDAObservable
-
- hep.aida.ref.ManagedObject
-
- hep.aida.ref.histogram.DataPointSet
-
- All Implemented Interfaces:
- IDevManagedObject, IDataPointSet, IManagedObject, AIDAListener, Connectable, IsObservable, java.io.Serializable
public class DataPointSet extends ManagedObject implements IDataPointSet, IsObservable, java.io.Serializable, AIDAListener
Basic user-level interface class for holding and managing a single set of "data points".- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DataPointSet(java.lang.String name, java.lang.String title, int dimOfPoints)DataPointSet(java.lang.String name, java.lang.String title, int dimOfPoints, int defaultCapacity)DataPointSet(java.lang.String name, java.lang.String title, int dimOfPoints, int defaultCapacity, java.lang.String options)DataPointSet(java.lang.String name, java.lang.String title, int dimOfPoints, java.lang.String options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description IDataPointaddPoint()Add a new empty IDataPoint at the end of the set.voidaddPoint(IDataPoint point)Add a copy of an IDataPoint at the end of the set.IAnnotationannotation()Get the IAnnotation of the IDataPointSet.voidclear()Remove all the IDataPoints in the set.intdimension()Get the dimension of the IDataPoints that can be stored in the set.doublelowerExtent(int coord)Get the lower value for a give axis.IDataPointpoint(int index)Get the IDataPoint at a give index in the set.voidremovePoint(int index)Remove the IDataPoint at a given index.voidscale(double scaleFactor)Scales the values and the errors of all the measurements of each point by a given factor.voidscaleErrors(double scaleFactor)Scales the errors of all the measurements of each point by a given factor.voidscaleValues(double scaleFactor)Scales the values of all the measurements of each point by a given factor.voidsetAnnotation(IAnnotation annotation)voidsetCoordinate(int coord, double[] values, double[] errors)Set the values and errors of a given coordinate all at once.voidsetCoordinate(int coord, double[] values, double[] errp, double[] errm)Set the values and errors of a given coordinate all at once.voidsetPoint(int index, IDataPoint point)Set the IDataPoint at a give index in the set.voidsetTitle(java.lang.String title)Set the title of the IDataPointSet.intsize()Get the current size of the IDataPointSet, i.e.voidstateChanged(java.util.EventObject e)java.lang.Stringtitle()Get the title of the IDataPointSet.doubleupperExtent(int coord)Get the upper value for a give axis.-
Methods inherited from class hep.aida.ref.ManagedObject
isFillable, name, setFillable, setName, type, typeForClass
-
Methods inherited from class hep.aida.ref.event.AIDAObservable
addListener, isConnected, removeAllListeners, removeListener, setConnected, setValid, setValidForAll
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface hep.aida.ref.event.IsObservable
addListener, removeAllListeners, removeListener, setValid
-
Methods inherited from interface hep.aida.ref.event.Connectable
isConnected, setConnected
-
-
-
-
Constructor Detail
-
DataPointSet
public DataPointSet(java.lang.String name, java.lang.String title, int dimOfPoints)
-
DataPointSet
public DataPointSet(java.lang.String name, java.lang.String title, int dimOfPoints, int defaultCapacity)
-
DataPointSet
public DataPointSet(java.lang.String name, java.lang.String title, int dimOfPoints, java.lang.String options)
-
DataPointSet
public DataPointSet(java.lang.String name, java.lang.String title, int dimOfPoints, int defaultCapacity, java.lang.String options)
-
-
Method Detail
-
annotation
public IAnnotation annotation()
Description copied from interface:IDataPointSetGet the IAnnotation of the IDataPointSet.- Specified by:
annotationin interfaceIDataPointSet- Returns:
- The IAnnotation.
-
setAnnotation
public void setAnnotation(IAnnotation annotation)
-
title
public java.lang.String title()
Description copied from interface:IDataPointSetGet the title of the IDataPointSet.- Specified by:
titlein interfaceIDataPointSet- Returns:
- The title.
-
setTitle
public void setTitle(java.lang.String title) throws java.lang.IllegalArgumentExceptionDescription copied from interface:IDataPointSetSet the title of the IDataPointSet.- Specified by:
setTitlein interfaceIDataPointSet- Parameters:
title- The new title.- Throws:
java.lang.IllegalArgumentException- If the title cannot be set.
-
dimension
public int dimension()
Description copied from interface:IDataPointSetGet the dimension of the IDataPoints that can be stored in the set.- Specified by:
dimensionin interfaceIDataPointSet- Returns:
- The dimension of the IDataPoints storable in the set.
-
clear
public void clear()
Description copied from interface:IDataPointSetRemove all the IDataPoints in the set. After this the IDataPointSet is as just created.- Specified by:
clearin interfaceIDataPointSet
-
size
public int size()
Description copied from interface:IDataPointSetGet the current size of the IDataPointSet, i.e. the number of IDataPoints contained in the set.- Specified by:
sizein interfaceIDataPointSet- Returns:
- The size of the IDataPointSet.
-
point
public IDataPoint point(int index)
Description copied from interface:IDataPointSetGet the IDataPoint at a give index in the set.- Specified by:
pointin interfaceIDataPointSet- Parameters:
index- The IDataPoint index.- Returns:
- The corresponding IDataPoint.
-
setPoint
public void setPoint(int index, IDataPoint point) throws java.lang.IllegalArgumentExceptionSet the IDataPoint at a give index in the set. This method is not in the IDataSet interface and is here for efficiency reasons- Parameters:
index- The IDataPoint index.point- The corresponding IDataPoint to be set at the index- Throws:
java.lang.IllegalArgumentException- If the index is < 0 or >= size().
-
addPoint
public IDataPoint addPoint() throws java.lang.RuntimeException
Description copied from interface:IDataPointSetAdd a new empty IDataPoint at the end of the set.- Specified by:
addPointin interfaceIDataPointSet- Returns:
- The newly added point.
- Throws:
java.lang.RuntimeException- If a new IDataPoint cannot be added to the set.
-
addPoint
public void addPoint(IDataPoint point) throws java.lang.IllegalArgumentException
Description copied from interface:IDataPointSetAdd a copy of an IDataPoint at the end of the set.- Specified by:
addPointin interfaceIDataPointSet- Parameters:
point- The IDataPoint to be added.- Throws:
java.lang.IllegalArgumentException- If the point has the wrong dimension or if the point cannot be added.
-
removePoint
public void removePoint(int index) throws java.lang.IllegalArgumentExceptionDescription copied from interface:IDataPointSetRemove the IDataPoint at a given index.- Specified by:
removePointin interfaceIDataPointSet- Parameters:
index- The index of the IDataPoint to be removed.- Throws:
java.lang.IllegalArgumentException- If the index is < 0 or >= size().
-
lowerExtent
public double lowerExtent(int coord) throws java.lang.IllegalArgumentExceptionDescription copied from interface:IDataPointSetGet the lower value for a give axis.- Specified by:
lowerExtentin interfaceIDataPointSet- Parameters:
coord- The coordinate of the axis.- Returns:
- The lower edge of the corresponding axis.
- Throws:
java.lang.IllegalArgumentException- if coord < 0 or coord >= dimension() or if the set is empty.
-
upperExtent
public double upperExtent(int coord) throws java.lang.IllegalArgumentExceptionDescription copied from interface:IDataPointSetGet the upper value for a give axis.- Specified by:
upperExtentin interfaceIDataPointSet- Parameters:
coord- The coordinate of the axis.- Returns:
- The upper edge of the corresponding axis.
- Throws:
java.lang.IllegalArgumentException- if coord < 0 or coord >= dimension() or if the set is empty.
-
scale
public void scale(double scaleFactor) throws java.lang.IllegalArgumentExceptionDescription copied from interface:IDataPointSetScales the values and the errors of all the measurements of each point by a given factor.- Specified by:
scalein interfaceIDataPointSet- Parameters:
scaleFactor- The scale factor.- Throws:
java.lang.IllegalArgumentException- If an illegal scaleFactor is provided.
-
scaleValues
public void scaleValues(double scaleFactor) throws java.lang.IllegalArgumentExceptionDescription copied from interface:IDataPointSetScales the values of all the measurements of each point by a given factor.- Specified by:
scaleValuesin interfaceIDataPointSet- Parameters:
scaleFactor- The scale factor.- Throws:
java.lang.IllegalArgumentException- If an illegal scaleFactor is provided.
-
scaleErrors
public void scaleErrors(double scaleFactor) throws java.lang.IllegalArgumentExceptionDescription copied from interface:IDataPointSetScales the errors of all the measurements of each point by a given factor.- Specified by:
scaleErrorsin interfaceIDataPointSet- Parameters:
scaleFactor- The scale factor.- Throws:
java.lang.IllegalArgumentException- If an illegal scaleFactor is provided.
-
setCoordinate
public void setCoordinate(int coord, double[] values, double[] errors) throws java.lang.IllegalArgumentExceptionDescription copied from interface:IDataPointSetSet the values and errors of a given coordinate all at once. If this method is called on an empty IDataPointSet, a number of points equal to the size of the arrays provided is created; if the IDataPointSet is not empty the dimension of the array must match with the size of the IDataPointSet.- Specified by:
setCoordinatein interfaceIDataPointSet- Parameters:
coord- The coordinate's indexvalues- The array of the values for the given coordinateerrors- The array with the symmetric errors.- Throws:
java.lang.IllegalArgumentException- if an illegal coordinate is provided or if there is a mismatch between the size of the array and the size of the IDataPointSet.
-
setCoordinate
public void setCoordinate(int coord, double[] values, double[] errp, double[] errm) throws java.lang.IllegalArgumentExceptionDescription copied from interface:IDataPointSetSet the values and errors of a given coordinate all at once. If this method is called on an empty IDataPointSet, a number of points equal to the size of the arrays provided is created; if the IDataPointSet is not empty the dimension of the array must match with the size of the IDataPointSet.- Specified by:
setCoordinatein interfaceIDataPointSet- Parameters:
coord- The coordinate's indexvalues- The array of the values for the given coordinateerrp- The array with the plus errors.errm- The array with the minus errors.- Throws:
java.lang.IllegalArgumentException- if an illegal coordinate is provided or if there is a mismatch between the size of the array and the size of the IDataPointSet.
-
stateChanged
public void stateChanged(java.util.EventObject e)
- Specified by:
stateChangedin interfaceAIDAListener
-
-
DMelt 3.0 © DataMelt by jWork.ORG