Class Utilities
java.lang.Object
org.scictrl.mp.orbitcorrect.accessories.Utilities
Class of useful methods, which are printing lists, matrices etc, that are in
use in DataBush.
- Author:
- igor@scictrl.com
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringcompareImputs(ElementList<AbstractDataBushElement> first, ElementList<AbstractDataBushElement> second) Compares elements from two diffrent ElementLists and returns report.Method compares if there are same elements in both lists.They represent same physical element in storage ring.If this is true, method compares diffrent values of these two elements.The diffrences in lists and elements (same) are written in StringBuffer.static Stringformat1D(double d) format1D.static Stringformat1E(double d) format1E.static Stringformat2D(double d) format2D.static Stringformat2E(double d) format2E.static Stringformat3D(double d) format3D.static Stringformat3E(double d) format3E.static Stringformat4D(double d) format4D.static Stringformat4E(double d) format4E.static StringformatdMHmsS.static StringformatdMHmsS(long d) formatdMHmsS.static StringformatdMHmsS(Date d) formatdMHmsS.static StringformatHHHHms(long duration) Format duration in seconds as <hours (can be more than 24)>.<minutes in hour>:<secondsin minute>static StringformatHHHHmsS(long duration) Format duration in milliseconds as <hours (can be more than 24)>.<minutes in hour>:<secondsin minute>static final intlazySearch(Object[] array, Object o) Searches for Object o in array of objects.If Object is found method returns index of object in the array.Otherwise -1 is returned.static StringprintBeamData(OpticsList list) Returns formated text of beam data.static voidprintBeamData(OpticsList list, PrintWriter st) Prints parameters (beam data) of OpticElements, that are in OpticsList, in PrintWriter.static StringprintBPMs(BPMonitorList list) Returns formatted text of names and position BMPs in BPMonitorList and position of beam at BPMs.static voidprintBPMs(BPMonitorList list, PrintWriter pr) Prints in PrintWriter name and position of BMPs and position of the beam at BPMs.static StringprintDBInfo(DataBushInfo info) printDBInfo.static voidprintDBInfo(DataBushInfo info, PrintWriter pr) Returns text of information that are hold in DataBushInfo.static StringReturns string describing elements in DataBush.static voidprintFormated(DataBush db, PrintWriter p) Prints to PrintWriter string describing elements in DataBush.static StringReturns string describing elements in ElementList.static voidPrints to PrintWriter string describing elements in ElementList.static StringprintMagnets(CalMagnetList list) Returns String of names,positions, and other properties of elements, held in CalMagnetList.static voidprintMagnets(CalMagnetList list, PrintWriter pr) Prints to PrintWriter names, positions, and other properties of elements, held in CalMagnetList.static StringprintMagnets(MagnetList list) Returns String of names,positions, and other properties of elements, held in MagnetList.static voidprintMagnets(MagnetList list, PrintWriter pr) Prints to PrintWriter names,positions, and other properties of elements, held in MagnetList.static StringprintMatrices(TransferList list) Returns String of names of elements in TransferList, their position in storage ring and their matrices.static voidprintMatrices(TransferList list, PrintWriter pr) Prints to PrintWriter names of elements, their position and matrices.TransferList holds elements.static StringprintMatrix(double[] m) Returns String of matrix elements.static StringprintMatrix(double[][] m) printMatrix.static voidprintMatrix(double[][] m, PrintWriter pr) Prints matrix to PrintWriter.static voidprintMatrix(double[] m, PrintWriter pr) printMatrix.static StringReturns String of matrix elements.static voidprintMatrix(DoubleMatrix m, PrintWriter pr) Prints matrix to PrintWriter.static StringtoStringBasics.
-
Method Details
-
format4E
format4E.
- Parameters:
d- a double- Returns:
- a
Stringobject
-
format3E
format3E.
- Parameters:
d- a double- Returns:
- a
Stringobject
-
format2E
format2E.
- Parameters:
d- a double- Returns:
- a
Stringobject
-
format1E
format1E.
- Parameters:
d- a double- Returns:
- a
Stringobject
-
format3D
format3D.
- Parameters:
d- a double- Returns:
- a
Stringobject
-
format2D
format2D.
- Parameters:
d- a double- Returns:
- a
Stringobject
-
format1D
format1D.
- Parameters:
d- a double- Returns:
- a
Stringobject
-
format4D
format4D.
- Parameters:
d- a double- Returns:
- a
Stringobject
-
formatdMHmsS
formatdMHmsS.
-
formatdMHmsS
formatdMHmsS.
- Parameters:
d- a long- Returns:
- a
Stringobject
-
formatdMHmsS
formatdMHmsS.
- Returns:
- a
Stringobject
-
formatHHHHmsS
Format duration in milliseconds as <hours (can be more than 24)>.<minutes in hour>:<secondsin minute>- Parameters:
duration- a long- Returns:
- HHH:mm:ss.SSS
-
formatHHHHms
Format duration in seconds as <hours (can be more than 24)>.<minutes in hour>:<secondsin minute>- Parameters:
duration- a long- Returns:
- HHH:mm:ss.SSS
-
compareImputs
public static String compareImputs(ElementList<AbstractDataBushElement> first, ElementList<AbstractDataBushElement> second) Compares elements from two diffrent ElementLists and returns report.Method compares if there are same elements in both lists.They represent same physical element in storage ring.If this is true, method compares diffrent values of these two elements.The diffrences in lists and elements (same) are written in StringBuffer.- Parameters:
first- ElementListsecond- ElementList- Returns:
- java.lang.String
- See Also:
-
lazySearch
Searches for Object o in array of objects.If Object is found method returns index of object in the array.Otherwise -1 is returned.- Parameters:
array- java.lang.Object[]o- java.lang.Object- Returns:
- boolean
-
printBeamData
Returns formated text of beam data.- Parameters:
list- DataBushInterface.ProtectedControlList- Returns:
- java.lang.String
- See Also:
-
printBeamData
Prints parameters (beam data) of OpticElements, that are in OpticsList, in PrintWriter.- Parameters:
list- DataBushInterface.ProtectedControlListst- aPrintWriterobject
-
printBPMs
Returns formatted text of names and position BMPs in BPMonitorList and position of beam at BPMs.- Parameters:
list- DataBushInterface.ProtectedControlList- Returns:
- java.lang.String
-
printBPMs
Prints in PrintWriter name and position of BMPs and position of the beam at BPMs.- Parameters:
list- DataBushInterface.ProtectedControlListpr- aPrintWriterobject
-
printDBInfo
Returns text of information that are hold in DataBushInfo.- Parameters:
info- aDataBushInfoDataBushInfo holds information about energy of baem.pr- aPrintWriterobject
-
printDBInfo
printDBInfo.
- Parameters:
info- aDataBushInfoobject- Returns:
- a
Stringobject
-
printFormated
Returns string describing elements in DataBush. String is formated in input-file code.- Parameters:
db- DataBush- Returns:
- java.lang.String
-
printFormated
Prints to PrintWriter string describing elements in DataBush. String is formated in input-file code.- Parameters:
db- DataBushp- aPrintWriterobject
-
printFormated
Returns string describing elements in ElementList. String is formated in input-file code.- Parameters:
l- ElementList- Returns:
- java.lang.String
-
printFormated
Prints to PrintWriter string describing elements in ElementList. String is formated in input-file code.- Parameters:
l- ElementListp- aPrintWriterobject
-
printMagnets
Returns String of names,positions, and other properties of elements, held in CalMagnetList.- Parameters:
list- aCalMagnetListobject- Returns:
- java.lang.String
-
printMagnets
Prints to PrintWriter names, positions, and other properties of elements, held in CalMagnetList.- Parameters:
list- aCalMagnetListobjectpr- aPrintWriterobject
-
printMagnets
Returns String of names,positions, and other properties of elements, held in MagnetList.- Parameters:
list- aMagnetListobject- Returns:
- java.lang.String
-
printMagnets
Prints to PrintWriter names,positions, and other properties of elements, held in MagnetList.- Parameters:
list- aMagnetListobjectpr- aPrintWriterobject
-
printMatrices
Returns String of names of elements in TransferList, their position in storage ring and their matrices.- Parameters:
list- TransferList- Returns:
- java.lang.String
-
printMatrices
Prints to PrintWriter names of elements, their position and matrices.TransferList holds elements.- Parameters:
list- TransferListpr- aPrintWriterobject
-
printMatrix
printMatrix.
- Parameters:
m- an array ofobjectsinvalid reference
double- Returns:
- a
Stringobject
-
printMatrix
Prints matrix to PrintWriter.- Parameters:
m- an array ofmatrixinvalid reference
doublepr- aPrintWriterobject
-
printMatrix
Returns String of matrix elements.- Parameters:
m- an array ofmatrixinvalid reference
double- Returns:
- a
Stringobject
-
printMatrix
printMatrix.
- Parameters:
m- an array ofobjectsinvalid reference
doublepr- aPrintWriterobject
-
printMatrix
Returns String of matrix elements.- Parameters:
m- aDoubleMatrixmatrix- Returns:
- a
Stringobject
-
printMatrix
Prints matrix to PrintWriter.- Parameters:
m- aDoubleMatrixmatrixpr- aPrintWriterobject
-
toStringBasics
toStringBasics.
- Parameters:
list- aElementListobject- Returns:
- java.lang.String
-