Skip to main content



      Home
Home » Newcomers » Newcomers » How to call java.lang.reflect.Array.getLength() for my class?(How to call java.lang.reflect.Array.getLength() for my class?)
icon10.gif  How to call java.lang.reflect.Array.getLength() for my class? [message #1713133] Sun, 01 November 2015 03:56 Go to next message
Eclipse UserFriend
I am trying to guess what kind of code do I need for the following pseudo code:
if sizeOf(Object[] DataSet) > #Representative sample) then
weighting applied for different types of customers applies to all entities.
Each entity might have its own weightings and classes within which to categorize entities.

I was initially trying to use Arrays.length, or else ArraysList collection (or another appropriate collection), but I think Eclipse is not quite using intellisense here to help me so I feel a bit confused.

public class Inspettore {
	
	public Inspettore(Object[] TrainingData)
	{
		
	}
	private int statistical_sample_min = 2500;
	
	public static void main (String[] args)
	{}
	
	public double getIndividualScore (Object _individual, double credit_score)
	{
		if (credit_score < threshold) {System.out.println("WARNING: credit score is less then threshold.");} 
		return credit_score;
	}
	
	public double getCorporateScore (Object _corporate, double financial_score, double financial_score_weight, 
			double strategic_risk, double strategic_risk_weight, 
			double reputation, double reputation_weight, 
			double customer_engagement, double customer_engagement_weight, 
			double organizational_factors, double organizational_factors_weight, 
			double service_provisioning, double service_provisioning_weight, 
			double learning_and_growth, double learning_and_growth_weight)
	{
		if  ((financial_score_weight < 1) && (strategic_risk_weight < 1) &&
			(reputation_weight < 1 ) && (customer_engagement_weight < 1) &&
			(customer_engagement_weight < 1) && (organizational_factors_weight < 1) &&
			(service_provisioning_weight < 1) && (learning_and_growth_weight < 1))
			
			{ double credit_score = (financial_score * financial_score_weight) + 
				(strategic_risk * strategic_risk_weight) +
				(reputation * reputation_weight) +
				(customer_engagement * customer_engagement_weight) +
				(organizational_factors * organizational_factors_weight) +
				(service_provisioning * service_provisioning_weight) +
				(learning_and_growth * learning_and_growth_weight);
			if (credit_score < threshold) {System.out.println("WARNING: credit score is less then threshold.");}
			return credit_score;  }
		else return -1;		//error condition
	}
	private int threshold = 100;
	
	public void setThreshold (int threshold)
	{
		this.threshold = threshold;
	}
}
Re: How to call java.lang.reflect.Array.getLength() for my class? [message #1713224 is a reply to message #1713133] Mon, 02 November 2015 09:12 Go to previous message
Eclipse UserFriend
Jonathan, is not for answering programming questions.

On 11/01/2015 01:56 AM, Jonathan Camilleri wrote:
> I am trying to guess what kind of code do I need for the following pseudo code:
> if sizeOf(Object[] DataSet) > #Representative sample) then
> weighting applied for different types of customers applies to all entities.
> Each entity might have its own weightings and classes within which to categorize entities.
>
> I was initially trying to use Arrays.length, or else ArraysList collection (or another appropriate collection), but I think Eclipse is not quite using intellisense here to help me so I feel a bit confused.
>
>
> public class Inspettore {
>
> public Inspettore(Object[] TrainingData)
> {
>
> }
> private int statistical_sample_min = 2500;
>
> public static void main (String[] args)
> {}
>
> public double getIndividualScore (Object _individual, double credit_score)
> {
> if (credit_score < threshold) {System.out.println("WARNING: credit score is less then threshold.");}
> return credit_score;
> }
>
> public double getCorporateScore (Object _corporate, double financial_score, double financial_score_weight,
> double strategic_risk, double strategic_risk_weight,
> double reputation, double reputation_weight,
> double customer_engagement, double customer_engagement_weight,
> double organizational_factors, double organizational_factors_weight,
> double service_provisioning, double service_provisioning_weight,
> double learning_and_growth, double learning_and_growth_weight)
> {
> if ((financial_score_weight < 1) && (strategic_risk_weight < 1) &&
> (reputation_weight < 1 ) && (customer_engagement_weight < 1) &&
> (customer_engagement_weight < 1) && (organizational_factors_weight < 1) &&
> (service_provisioning_weight < 1) && (learning_and_growth_weight < 1))
>
> { double credit_score = (financial_score * financial_score_weight) +
> (strategic_risk * strategic_risk_weight) +
> (reputation * reputation_weight) +
> (customer_engagement * customer_engagement_weight) +
> (organizational_factors * organizational_factors_weight) +
> (service_provisioning * service_provisioning_weight) +
> (learning_and_growth * learning_and_growth_weight);
> if (credit_score < threshold) {System.out.println("WARNING: credit score is less then threshold.");}
> return credit_score; }
> else return -1; //error condition
> }
> private int threshold = 100;
>
> public void setThreshold (int threshold)
> {
> this.threshold = threshold;
> }
> }
>
Previous Topic:Re: available software
Next Topic:Apache Commons
Goto Forum:
  


Current Time: Sat Apr 26 21:28:11 EDT 2025

Powered by FUDForum. Page generated in 0.08604 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top