Questions tagged [object-identity]

whether two variable are referring to the same object.

Identity is a property of an object that uniquely defines its abstract location.

Two objects stored in variable a and b are said to have the same identity, if a and b actually refer to the same object (same class, same abstract memory location). On can test identity of two objects using

As an implementation detail, identity hints about potential co-location of objects in physical or virtual memory, and thus may be related to performance. In some languages, one can get a value representing the object's identity, or address (although this token is only valid during the object's lifetime):

54 questions
0
votes
0 answers

JPA Repositories object identity

When loading an entity twice using findOne() two different objects with the same values are returned. I would have expected that an object identity is preserved using an Identity map. Is there any reason why this is not the case or is there an way…
0
votes
6 answers

A Question about JTextField in Java

I met a small problem when running a Java class that I wrote, though the design is pretty straightforward. I've created a JPanel, and I've added four JTextFields onto it and I've attached a button to this JPanel, too. Then, I've associated an…
Kevin
  • 6,711
  • 16
  • 60
  • 107
0
votes
1 answer

Selenium Object Identification Issues

I have a combo box with 2 values(say Xreg and MBA). By default only one value(either Xreg or MBA) will be displayed based on a search criteria.. The xpath for Xreg is…
0
votes
3 answers

The == operator in Java

the following is true in Java "abc"=="abc" Why? The two Strings are two different objects, they should not have the same object identity?
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
0
votes
1 answer

Selfschizofrenia in Ruby

I'm looking at a piece of code that suffers from self schizophrenia. One object is wrapping another object and to the programmer this is hidden and the code will expect the identity of the wrapper and the wrapped to be the same. This is only related…
Rune FS
  • 21,497
  • 7
  • 62
  • 96
0
votes
2 answers

php differentiate between different table id's?

i have different objects with there id's, all id's are unique. objects photo feed event comment all of there id's are unique and never repeated again. i want to pass that id in url like this: http://domain.com/{object_id} and object id should tell…
Basit
  • 16,316
  • 31
  • 93
  • 154
0
votes
2 answers

Using one method in place of many

I am trying to learn Objective-C for iOS. I have tried researching this, but I must not be using the right keywords. I have several labels that are simply named, Label1, Label2, etc. I also have a ton of code that basically looks the same except…
tcison
  • 13
  • 1
  • 5
-1
votes
3 answers

Purpose of overloading identity operator

Why isn't it possible in Python to overload the identity comparison operator? Every other comparison operator is possible to customize, so why not identity comparison?
RyPeck
  • 7,830
  • 3
  • 38
  • 58
-2
votes
2 answers

error: argument -s/--source is required

I copied this code from Github, but its not working to me. Sample Code: ap = argparse.ArgumentParser() ap.add_argument("-s", "--source", required=True, help="Path to the source of shapes") ap.add_argument("-t", "--target", required=True, help="Path…
1 2 3
4