Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4112520
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:12:23+00:00 2026-05-20T22:12:23+00:00

Let Abstract be an abstract class, and A1,A2,…,An concrete classes that inherit from Abstact

  • 0

Let Abstract be an abstract class, and A1,A2,...,An concrete classes that inherit from Abstact. Each one of Ai has a list of Abstract and a pre-defined, known at compile time, set of primitive types, let’s assume we have a hush function for them, and there are no ‘loops’ in the structure of each concrete element.

Two elements e1 and e2 are identical if they have the same values for the predefined primitives, and if for each Abstract in e1, there exists an Abstract in e2 such that e1 and e2 are identical. (in other words, order is not important).

I am looking for a good hash heuristic for this kind of problem. It shouldn’t (and as far as I know, can’t be) a perfect hash function, but it should be good and easy to compute at run time.

I’ll be glad if someone can give me some guidelines how to implement such a function, or direct me to an article that addresses this problem.

PS I am writing in Java, and I assume (correct me if I am wrong) the built in hash() won’t be good enough for this problem.

EDIT :

the lists and primitives are fixed after construction, but are unknown at compile time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T22:12:23+00:00Added an answer on May 20, 2026 at 10:12 pm

    Use Google Guava’s utilities… Objects.hashCode() is great. Also, the source is available, and they have solved the problem you state, so you can take a look at their solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one abstract class -let's say myBase. And I want all the classes
Let we have one abstract class: classdef ACalculation < handle methods (Abstract) [result] =
Let's say I have some classes like this: abstract class View(val writer: XMLStreamWriter) {
First suppose that I have an abstract class, let's call it AbstractClass. Suppose public
Let's see if I can describe this properly... I have an abstract class that
Let's say I have a class A and this class has a List l
Let's say I have this class: public abstract class CustomerCollectionBase : Collection<Customer>{} One of
Let's say that I have this: public abstract class myClass<T> : Ob<T> where T
Let's say I have three classes set up as follows: abstract Class A {
Is it good practice to let abstract classes define instance variables? public abstract class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.