Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refact: reorder methods using eclipse reorder code #963

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/main/java/neqsim/api/ioc/CalculationResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ public CalculationResult(Double[][] fluidProperties, String[] calculationError)
this.calculationError = calculationError;
}

/** {@inheritDoc} */
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + Arrays.hashCode(calculationError);
result = prime * result + Arrays.deepHashCode(fluidProperties);
return result;
}

/** {@inheritDoc} */
@Override
public boolean equals(Object obj) {
Expand All @@ -53,4 +43,14 @@ public boolean equals(Object obj) {
return Arrays.equals(calculationError, other.calculationError)
&& Arrays.deepEquals(fluidProperties, other.fluidProperties);
}

/** {@inheritDoc} */
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + Arrays.hashCode(calculationError);
result = prime * result + Arrays.deepHashCode(fluidProperties);
return result;
}
}
40 changes: 20 additions & 20 deletions src/main/java/neqsim/dataPresentation/SampleXYDataSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,13 @@ public SampleXYDataSource(double[][] p, String[] name, String title, String xaxi
}

/**
* Returns the x-value for the specified series and item. Series are numbered 0, 1, ...
*
* @param series The index (zero-based) of the series;
* @param item The index (zero-based) of the required item;
* @return The x-value for the specified series and item.
*/
public Number getXValue(int series, int item) {
return (Double.valueOf(points[2 * series][item]));
}

/**
* Returns the y-value for the specified series and item. Series are numbered 0, 1, ...
* Returns the number of items in the specified series.
*
* @param series The index (zero-based) of the series;
* @param item The index (zero-based) of the required item;
* @return The y-value for the specified series and item.
* @return The number of items in the specified series.
*/
public Number getYValue(int series, int item) {
return (Double.valueOf(points[(series * 2 + 1)][item]));
public int getItemCount(int series) {
return items[series];
}

/**
Expand All @@ -100,12 +88,24 @@ public String getSeriesName(int series) {
}

/**
* Returns the number of items in the specified series.
* Returns the x-value for the specified series and item. Series are numbered 0, 1, ...
*
* @param series The index (zero-based) of the series;
* @return The number of items in the specified series.
* @param item The index (zero-based) of the required item;
* @return The x-value for the specified series and item.
*/
public int getItemCount(int series) {
return items[series];
public Number getXValue(int series, int item) {
return (Double.valueOf(points[2 * series][item]));
}

/**
* Returns the y-value for the specified series and item. Series are numbered 0, 1, ...
*
* @param series The index (zero-based) of the series;
* @param item The index (zero-based) of the required item;
* @return The y-value for the specified series and item.
*/
public Number getYValue(int series, int item) {
return (Double.valueOf(points[(series * 2 + 1)][item]));
}
}
78 changes: 39 additions & 39 deletions src/main/java/neqsim/dataPresentation/dataHandeling.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,39 @@ public class dataHandeling {
*/
public dataHandeling() {}

/**
* Returns the number of items in the specified series.
*
* @param series The index (zero-based) of the series;
* @return The number of items in the specified series.
*/
public int getItemCount(int series) {
return 81;
}

/**
* <p>
* getXValue.
* getLegendItemCount.
* </p>
*
* @param series a int
* @param item a int
* @return a {@link java.lang.Number} object
* @return a int
*/
public Number getXValue(int series, int item) {
return Double.valueOf(-10.0 + (item * 0.2));
public int getLegendItemCount() {
return 2;
}

/**
* Returns the y-value for the specified series and item. Series are numbered 0, 1, ...
* <p>
* getLegendItemLabels.
* </p>
*
* @param series The index (zero-based) of the series;
* @param item The index (zero-based) of the required item;
* @return The y-value for the specified series and item.
* @return an array of {@link java.lang.String} objects
*/
public Number getYValue(int series, int item) {
if (series == 0) {
return Double.valueOf(Math.cos(-10.0 + (item * 0.2)));
} else {
return Double.valueOf(2 * (Math.sin(-10.0 + (item * 0.2))));
}
public String[] getLegendItemLabels() {
String[] str = new String[2];
str[1] = "";
str[2] = "";
return str;
}

/**
Expand Down Expand Up @@ -79,39 +86,32 @@ public String getSeriesName(int series) {
}
}

/**
* Returns the number of items in the specified series.
*
* @param series The index (zero-based) of the series;
* @return The number of items in the specified series.
*/
public int getItemCount(int series) {
return 81;
}

/**
* <p>
* getLegendItemCount.
* getXValue.
* </p>
*
* @return a int
* @param series a int
* @param item a int
* @return a {@link java.lang.Number} object
*/
public int getLegendItemCount() {
return 2;
public Number getXValue(int series, int item) {
return Double.valueOf(-10.0 + (item * 0.2));
}

/**
* <p>
* getLegendItemLabels.
* </p>
* Returns the y-value for the specified series and item. Series are numbered 0, 1, ...
*
* @return an array of {@link java.lang.String} objects
* @param series The index (zero-based) of the series;
* @param item The index (zero-based) of the required item;
* @return The y-value for the specified series and item.
*/
public String[] getLegendItemLabels() {
String[] str = new String[2];
str[1] = "";
str[2] = "";
return str;
public Number getYValue(int series, int item) {
if (series == 0) {
return Double.valueOf(Math.cos(-10.0 + (item * 0.2)));
} else {
return Double.valueOf(2 * (Math.sin(-10.0 + (item * 0.2))));
}
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/neqsim/util/unit/BaseUnit.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public double getSIvalue() {

/** {@inheritDoc} */
@Override
public double getValue(String fromunit) {
public double getValue(double val, String fromunit, String tounit) {
throw new UnsupportedOperationException("Unimplemented method 'getValue'");
}

/** {@inheritDoc} */
@Override
public double getValue(double val, String fromunit, String tounit) {
public double getValue(String fromunit) {
throw new UnsupportedOperationException("Unimplemented method 'getValue'");
}
}
64 changes: 32 additions & 32 deletions src/main/java/neqsim/util/unit/NeqSimUnitSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
* @version $Id: $Id
*/
public class NeqSimUnitSet {
private String temperatureUnit = "K";

private String pressureUnit = "bara";

private String flowRateUnit = "mol/sec";

private String componentConcentrationUnit = "molefraction";

/**
* <p>
* Getter for the field <code>componentConcentrationUnit</code>.
Expand All @@ -22,70 +30,67 @@ public String getComponentConcentrationUnit() {

/**
* <p>
* Setter for the field <code>componentConcentrationUnit</code>.
* Getter for the field <code>flowRateUnit</code>.
* </p>
*
* @param componentConcentrationUnit the componentConcentrationUnit to set
* @return the flowRateUnit
*/
public void setComponentConcentrationUnit(String componentConcentrationUnit) {
this.componentConcentrationUnit = componentConcentrationUnit;
public String getFlowRateUnit() {
return flowRateUnit;
}

/**
* <p>
* Getter for the field <code>flowRateUnit</code>.
* Getter for the field <code>pressureUnit</code>.
* </p>
*
* @return the flowRateUnit
* @return the pressureUnit
*/
public String getFlowRateUnit() {
return flowRateUnit;
public String getPressureUnit() {
return pressureUnit;
}

/**
* <p>
* Setter for the field <code>flowRateUnit</code>.
* Getter for the field <code>temperatureUnit</code>.
* </p>
*
* @param flowRateUnit the flowRateUnit to set
* @return the temperatureUnit
*/
public void setFlowRateUnit(String flowRateUnit) {
this.flowRateUnit = flowRateUnit;
public String getTemperatureUnit() {
return temperatureUnit;
}

/**
* <p>
* Getter for the field <code>pressureUnit</code>.
* Setter for the field <code>componentConcentrationUnit</code>.
* </p>
*
* @return the pressureUnit
* @param componentConcentrationUnit the componentConcentrationUnit to set
*/
public String getPressureUnit() {
return pressureUnit;
public void setComponentConcentrationUnit(String componentConcentrationUnit) {
this.componentConcentrationUnit = componentConcentrationUnit;
}

/**
* <p>
* Setter for the field <code>pressureUnit</code>.
* Setter for the field <code>flowRateUnit</code>.
* </p>
*
* @param pressureUnit the pressureUnit to set
* @param flowRateUnit the flowRateUnit to set
*/
public void setPressureUnit(String pressureUnit) {
this.pressureUnit = pressureUnit;
public void setFlowRateUnit(String flowRateUnit) {
this.flowRateUnit = flowRateUnit;
}

/**
* <p>
* Getter for the field <code>temperatureUnit</code>.
* Setter for the field <code>pressureUnit</code>.
* </p>
*
* @return the temperatureUnit
* @param pressureUnit the pressureUnit to set
*/
public String getTemperatureUnit() {
return temperatureUnit;
public void setPressureUnit(String pressureUnit) {
this.pressureUnit = pressureUnit;
}

/**
* <p>
* Setter for the field <code>temperatureUnit</code>.
Expand All @@ -96,9 +101,4 @@ public String getTemperatureUnit() {
public void setTemperatureUnit(String temperatureUnit) {
this.temperatureUnit = temperatureUnit;
}

private String temperatureUnit = "K";
private String pressureUnit = "bara";
private String flowRateUnit = "mol/sec";
private String componentConcentrationUnit = "molefraction";
}
Loading
Loading