public class NFEUtil
extends java.lang.Object
Constructor and Description |
---|
NFEUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getCostExpression(AnalysisCustomizedCost analysisCustomizedCost, NFEFeatureLayer featureLayer, NFEFeatureClass featureClass)
Returns the customized expression (analysisCustomizedCost.getExpression) if the customized cost applies to the featureLayer and featureClass, null otherwise.
|
static double |
getCustCostOfLink(java.sql.Connection conn, NFEModel nfeModel, java.util.List<AnalysisCustomizedCost> analysisCustomizedCosts, java.lang.Long linkId, NFEExpressionAnalyzer nfeExpressionAnalyzer)
Returns the link custom cost.
|
static java.lang.String |
getErrorMessage(java.lang.String exceptionMessage)
Extracts the error message from an exception message.
|
static byte[] |
getFileAsByteArray(java.lang.String fileName)
Returns the file in path oracle/spatial/network/nfe/images/imageName
|
static java.lang.Object |
getResultSetColumnValue(java.sql.ResultSet resultSet, java.lang.String columnName, NFEAttributeType expectedType)
Returns the column value of the result set.
|
static java.lang.String |
getSQLInStringWithLimit(java.util.List<java.lang.Long> ids, java.lang.String columnToBeUsed, int limit)
Creates a SQL string in format: columnToBeUsed IN (id[1], id[2],...id[limit]) OR IN (id[x], id[x+1],...id[x+limit])
|
static java.lang.String |
getStringWithoutLastComma(java.lang.String s)
Gets a substring from the string start to the first comma.
|
static boolean |
isEmpty(java.lang.String propertyValue)
Checks for nulls and empty strings.
|
static java.lang.Object |
toAttributeType(java.lang.String strValue, NFEAttributeDescriptor attrDesc)
Returns the string value in the type of the specified attribute.
|
public static boolean isEmpty(java.lang.String propertyValue)
propertyValue
- string to be evaluatespublic static java.lang.String getStringWithoutLastComma(java.lang.String s)
s
- stringpublic static java.lang.Object getResultSetColumnValue(java.sql.ResultSet resultSet, java.lang.String columnName, NFEAttributeType expectedType) throws java.sql.SQLException
NUMBER = resultSet.getDouble(columnName) INTEGER = resultSet.getLong(columnName) VARCHAR2 = resultSet.getString(columnName) DATE = resultSet.getDate(columnName) TIMESTAMP = resultSet.getTime(columnName) SDO_GEOMETRY = resultSet.getObject(columnName)
resultSet
- result setcolumnName
- column nameexpectedType
- expected typejava.sql.SQLException
- if an SQL exception is thrownpublic static java.lang.Object toAttributeType(java.lang.String strValue, NFEAttributeDescriptor attrDesc)
strValue
- stringattrDesc
- attributepublic static java.lang.String getSQLInStringWithLimit(java.util.List<java.lang.Long> ids, java.lang.String columnToBeUsed, int limit)
ids
- identifierscolumnToBeUsed
- columnlimit
- limitpublic static java.lang.String getErrorMessage(java.lang.String exceptionMessage)
exceptionMessage
- Message from an exception. Format expected: "ORA-[error-code]: [error-message] \n[posible-extra-information]"exceptionMessage
format is not as indicated.public static double getCustCostOfLink(java.sql.Connection conn, NFEModel nfeModel, java.util.List<AnalysisCustomizedCost> analysisCustomizedCosts, java.lang.Long linkId, NFEExpressionAnalyzer nfeExpressionAnalyzer)
conn
- connectionnfeModel
- modelanalysisCustomizedCosts
- customized cost datalinkId
- link identifiernfeExpressionAnalyzer
- expression analyzerpublic static java.lang.String getCostExpression(AnalysisCustomizedCost analysisCustomizedCost, NFEFeatureLayer featureLayer, NFEFeatureClass featureClass)
analysisCustomizedCost
- customized cost datafeatureLayer
- feature layerfeatureClass
- feature classpublic static byte[] getFileAsByteArray(java.lang.String fileName)
fileName
- file name