JAVA-INDEX.COM
Java programming resources: FAQs, tutorials, compiler and browser download sites, documentation, books lists, IDEs, etc.
Home....
|
log in....
|
Pub my question!
|
Sign-up....
Java-index
>>
Java Essentials
>>
Java Programming
Control the instance of a class
How can I restrict a class that it can not have more than 5 instances?Please help me to solve this problem.
[121 byte] By [
Rakesh_Thawaita
] at [2007-11-26 18:09:37]
««
How to read colors from image
»»
Solaris 10x86 06/06 HP DL585 G1 with Grub issues.
# 1
http://en.wikipedia.org/wiki/Multiton_pattern
bellyrippera
at 2007-7-9 5:41:38 >
# 2
Or have a static counter to increase in constructor and make the constructor throw an exception when certain value is exceeded.Mike
bellyrippera
at 2007-7-9 5:41:38 >
# 3
Thanks Mike.. this is what I was looking for.
Rakesh_Thawaita
at 2007-7-9 5:41:38 >
# 4
"Multition", eh? I was looking for a word to describe it, but I don't think I've heard that one ever used.
DrLaszloJamfa
at 2007-7-9 5:41:38 >
# 5
Multiton. I guess its better than Multipleton. =)
duckbilla
at 2007-7-9 5:41:38 >
# 6
Strange because first time I saw this word was in a discussion here, so I assumed it is widely accepted.Mike
bellyrippera
at 2007-7-9 5:41:38 >
# 7
Sounds like a cartoon robot villain to me.
DrLaszloJamfa
at 2007-7-9 5:41:38 >
Java Essentials
Cannot make a static reference to a non static field
OOP Design Theory
Interface implementation doubt
methods not visible
why cant a class have its modifiers as private or protected?
Saving from a TextPane
jar files with JCreator
help needed for java mail services
finding whether the user has administrative rights
Why is dialog not on top of parent window?
Java Programming
Packet Analyzer
repainting graphics with JAI
Round up to the nearest 1000. Need help urgently
ProcessBuilder-command arguments that contain speech marks.
TreeSelectionListener() - one click two events!
java.util.Random: nextInt vs nextDouble
Using Runtime class
"jdbc/SchoolDataSource" is it a jndi name ?
Problem's overriding methods
Live-updating jtextarea with process output
Java Essentials New Topic
Packet Analyzer
repainting graphics with JAI
ProcessBuilder-command arguments that contain speech marks.
TreeSelectionListener() - one click two events!
java.util.Random: nextInt vs nextDouble
Problem's overriding methods
Live-updating jtextarea with process output
import java.net.URL;
Java Essentials Hot Topic
Round up to the nearest 1000. Need help urgently
Cannot make a static reference to a non static field
OOP Design Theory
Interface implementation doubt
methods not visible
Using Runtime class
why cant a class have its modifiers as private or protected?
Constructor is atomic?
Java Essentials
Java Programming
New To Java
Training
All Classified
Archived Forums
Enterprise & Remote Computing
Java Essentials
Desktop
Core
Solaris Operating System
Security
Database Connectivity
Java Mobility Forums
Web & Directory Servers
Development Tools
Application & Integration Servers
Java HotSpot Virtual Machine
Other Topics
E-Mail, Calendar, & Collaboration
Developer Tools
General
Administration Tools
Sun Hardware
Storage Forums
Java Enterprise System
StarOffice
Open Source Technologies
BigAdmin
Real-Time
Java Coding