class

Using the value from the private variable or from the actual property in class functions?

When referencing class properties from a function within the class do you use the value from the actual property or the private variable value? Which way is best? Why? public class private m_Foo as double public property Foo() as double get return m_Foo end get set(byval value as double) m_Foo = value ...

Delphi: storing data in classes vs records, memory usage reduction

Hi, I have quite a lot of data to store, read and modify in memory while the application works. The data could be compared to a tree, where each node is described by limited number of strings and integers, and has quite a lot of subelements. Currently the data is stored using classes/objects, like TRootElement = class fName, fDescripti...

Java - How do I use a class file?

Hi, I'm new to Java and am wondering about how to import class files into netbeans and use it. I understand that a class file is machine-readable byte code but I don't care what's going on under the hood. I'd just like to import it into my current project and have it recognize it so I can use the class. Also, the class file is embedde...

Determine which jar file a class is from

Hi all, I am not in front of an IDE right now, just looking at the API specs ... CodeSource src = MyClass.class.getProtectionDomain().getCodeSource(); if (src != null) { URL jar = src.getLocation(); I want to determine which jar file a class is from, is this the way to do it? Walter ...

#2015: Invalid BitmapData.

in my class, if I create bitmapData like this private var tImage:BitmapData; public function object():void { tImage = new BitmapData(30,30,false,0x000000); } I get the following error ArgumentError: Error #2015: Invalid BitmapData. But if I declare the varible inside the method public function object():void { var tIm...

Using a named query in a hbm with import class

In my MSSQL server I have a SQL view called AllFavourite. In order to load the data into my DTO class I have the following in my hbm.xml file... <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Domain.Model.Entities" assembly="Domain.Model"> <import class="AllFavourite"/>...

create instance of two classes together

Hello! Im trying to display two list: one for categories and brand but only the categories are being displayed. And when I remove the code for categories, the brands are being displayed. Is it because it is not possible to create instances of two classes in the same php page? In index.php: <?php $obj = new CategoryList(); if (metho...

Creating a Javascript class with dynamic functions.

Let's start by saying that my code works perfectly fine, there is no problem with it. I just want to wrap it all up with a nice class for dynamic future use, and I wonder how to do that in Javascript in the most correct way. load_server is a function that puts an Ajax request. pagination() / itemlinks() are functions that go through the...

One long class or many shorter classes?

In PHP, is there any performance impact on using one long class with a lot of functions in it? Or is it advisable to use many small classes and call them separately when needed? I am a newbie in OOPS and please ignore any silliness in the question. Thanks. ...

Hierarchy of Classes in C#

Hello there! I have this set of classes: Node (SUPER Class) |------ NodeType1 (Class) |----------NodeType2 (Class) There are fields that the type1 and type2 have in common (For example: NAME). If i declare the NAME field in the SUPER class (Node) how should I access those variables in the types classes? How can i make those property's? ...

equals() method of java.

I've the following test program. I create 3 Integer references. I create 2 Integer objects and make references i1 and i2 refer them respectively. I make reference i3 equal to i1. Now i1 equals() i3 should be obviously true as they both refer to same object on heap. But why should i1 be equal() to i2 ? They are refering to two different o...

Sharing var from one function to the other function in PHP Class

Well, I am not good at scripting, and I am kinda Photoshop guy. I am also new at PHP, so please bear with me. I am currently creating web form generation class which needs to be reusable and flexible for localization. What I hope to ask at here is: How I can pass var from one function($avInq->textFeild) to the other function($avInq->J...

Any difference between 'b' and 'c'?

class a(object): b = 'bbbb' def __init__(self): self.c = 'cccc' I think they are the same; is there any difference? ...

jQuery: selector question (classname with space)

hi all, i'm trying to get a div which has "panel current" as classname. the problem is the space - how can i select it? thx ...

JavaScript CSS how to add and remove multiple CSS classes to an element

How can assign multiple css classes to an html element through javascript without using any libraries? ...

Objective-C, Set UITextField Value from this:

Hi, I have been told that to access a UITextField in the setup i have with my app, i have to use a subView whatever this is (in a noob at objectivec) and i was given this [subview isKindOfClass:[UITextField class]] Where do i put this? And how can i use it to set the value of my UITextField? :D Thanks! Update: I want to set the valu...

Using Intent from non-activity class

I have three classes one main-activity(named MainMap), one non-activity class(named MyItemizedOverlay), and one activity class(named AudioStream). I want to start AudioStream activity from non-activity class but i don't know how to. i tried this is in third class(called MyItemizedOverlay): Intent myIntentA = new I...

Why i cant use bitmap class on dll class?

For example: Public Class Class1 Public Sub Some() Dim Image As New Bitmap("C:\image.bmp") End Function End Class Displays an error on Bitmap which says "Name Bitmap is not declared". Some solution? is impossible use Bitmap class or another class? ...

Is it bad practice to declare a class's ctor 'final' in PHP?

If I have a parent class that is extended by lots and lots of other classes, and I want to make sure the parent class's constructor is ALWAYS run, is it a bad idea to declare the constructor final? I was thinking of doing something like this: class ParentClass { public final function __construct() { //parent class initial...

Classes. Whats the point?

I'm fairly new to OOP in PHP, I've made a couple of basic scripts but nothing impressive. All I've really taken from it is that it would probably be easier just make a collection of functions and include them. The structure of classes seems to just confuse what was otherwise a simple process. And in collating everything into a class it...