0
votes
0answers
46 views

How do I access the data in Java objects returned by User.getAddresses() and User.getPhones()? [migrated]

In com.google.api.services.admin.directory.model.User, many methods, such as getAddresses() and getPhones(), return a Java object that I can’t figure out what to do with. Using toString(), I can ...
5
votes
2answers
402 views

Why does java collections not supply a function for the index of max value?

I have been using Collections.max(list) for many projects, but I occasionally want to find the index of that maximum element. I feel silly writing a function to do this for myself in every program I ...
0
votes
1answer
178 views

API always returns JSONObject or JSONArray Best practices

I'm making an API that will return data in JSON. I also wanted on client side to make an utility class to call this API. Something like : JSONObject sendGetRequest(Url url); JSONObject ...
0
votes
1answer
126 views

Reflective discovery of an inner class in an API

Let me ask you, as this bothers me for quite a while but appears to be subjectively the best solution for my problem, if reflective discovery of an inner class for API purposes is that bad idea? ...
2
votes
3answers
328 views

In Java, what are some good ways to separate APIs from implementation of *entire projects*?

Imagine you have a software module, which is a plugin to some program (similar to Eclipse) and you want it to have an API which other plugins can call. Your plugin is not freely available, so you want ...
0
votes
3answers
298 views

Why do APIs generally consist of interfaces? [duplicate]

I am starting out in Java API design and in reading existing code bases, I have found that most APIs consist of interfaces only with their implementations bundled in a different package. Having read ...
4
votes
3answers
1k views

Java's Boolean class - why not an enum?

It seems to me that the Boolean class is an ideal candidate to be implemented as an enum. Looking at the source code, most of the class is static methods which could be moved unchanged to an enum, ...
0
votes
1answer
106 views

Use global variables or methods in an API's frontend

I am currently designing a graphics library in Java and now it's come to making the frontend I am curious why I have never seen libraries using global variables for their settings/properties - in-fact ...
0
votes
2answers
166 views

Domain Name Lookup

I'm trying to automate the process of sending many domain name lookup requests. I tried to do this by sending for example http request to domain registry site like Whois.net, but I notice they block ...
2
votes
2answers
182 views

Are the IETF BCP 47 language tags defined as enums anywhere in JDK?

Are the IETF BCP 47 language tags defined as enums anywhere in JDK? For Locale.forLanguageTag() we pass values like fr-FR, jp-JP etc. Are there any enums already provided by JDK for it? Or should ...
1
vote
1answer
228 views

Who is responsible for updating the Java API and how can other individuals contribute?

I made a search on google to find out who are the people in Oracle responsible for updating the Java API in other words who are those responsible for adding new classes and methods to the API and ...
1
vote
1answer
451 views

Return values for CRUD methods?

I'm writing a basic web API in Java that does what almost all others do: take input, validate it, then do CRUD operations on the DB. I've written several APIs before, and I've pretty much already ...
3
votes
2answers
608 views

Should I return Collection or ImmutableCollection from a method?

When writing an API in Java, returning an immutable collection of some sort, I've got the option of returning Collection (or List, Map, etc) from the method, or guava's ImmutableCollection (or ...
-1
votes
1answer
153 views

A good way to learn a language and fully understand its features and classes is to try all methods in the API [closed]

I have an idea that to learn a language (i.e. Java)I need to try all methods from language's API; i want to try to use methods from its API. is this a good idea? there are 10 000 methods in Java API. ...
13
votes
3answers
3k views

Joda Time vs Java Time

Although Joda is feature rich and more sophisticated than standard Java time, it may not always be the best thing to use. How do I decide if I should use Joda Time or Java Time in any Java code? Is ...
2
votes
1answer
969 views

OCR API (in Java) with Word (NOT MS-WORD) extraction [closed]

My Situation I need to develop an application which does crowd-sourced Image-To-Text service (just like google's reCaptcha). So I need an OCR API which can find words in an image with some text. ...
14
votes
3answers
856 views

Does decoupling trump DRY in REST?

I am building a REST API to expose most of functionality of an existing Java API. Both APIs are for internal use within my organization; I do not have to design for external use. I have influence ...
6
votes
6answers
545 views

Should I continue teaching old Java input methods alongside the new ones?

I've been imparting a Java introduction course for several years. Some slides explain how to read from files and keyboard using BufferedReaders, InputStreams, FileInputStreamReaders etc. I'm adding ...
-2
votes
1answer
361 views

What do ptLineDist and relativeCCW do? [closed]

I saw these methods in the Line2D Java Docs but did not understand what they do? Javadoc for ptLineDist says: Returns the distance from a point to this line. The distance measured is the ...
5
votes
2answers
1k views

Why does the add() method of a Linkedlist return true in Java?

Why does the add method of a Linkedlist return true in Java? http://docs.oracle.com/javase/1.5.0/docs/api/java/util/LinkedList.html#add(E) Why not just make it a void method? I know it says "per the ...
0
votes
3answers
440 views

API design and versioning using EJB

I have an API that is EJB based (i.e. there are remote interfaces defined) that most of the clients use. As the client base grows there are issues with updates to the API and forcing clients to have ...
3
votes
3answers
1k views

Designing an API on top with Java RMI and Rest APIs

I'm working on the backend of a java web application. We have a document repository (Fedora Commons specifically) where we house xml files. I want to abstract the API of the repository internally so ...
5
votes
2answers
172 views

API design involving standard and custom settings

Suppose a class allows some kind of configuration that has some well-known default values but also has the option of defining a custom value. For example, suppose you want to let users configure a ...
20
votes
11answers
3k views

Is it a really required skill to program without API documentation?

I barely passed my Java programming exam today. I had to answer some general questions about threading which I did well and to write a little threaded program which was worse. I had to connect my ...
4
votes
1answer
506 views

Eloqua API Full Code Example in JAVA

Is there anyone out there who has mastered to retrieve some data programmatically from Eloqua? First of all, I'm more or less a newbie, as far as JAVA. I can follow tutorials, take directions and ...
3
votes
1answer
191 views

Thread safe graph libraries

I am looking for a good Java Graph Library which is thread safe for concurrent access. JGraphT, JUNG, JTS are very good but again for concurrent access I will have to synchronize it externally which ...
3
votes
1answer
8k views

What is the best way to comment a deprecated class in Java?

I would like to know the best way to add a comment to identify a deprecated class in Java. Should I remove the previous comment added to the top of the class that helps another programmer to know what ...
0
votes
6answers
732 views

Java API vs. Other APIs [closed]

I'm more at the novice end of the software developer spectrum, but nevertheless I've had exposure to quite a few programming languages and frameworks. From all the technologies I've used, I haven't ...
54
votes
5answers
3k views

Why were Java collections implemented with “optional methods” in the interface?

During my first implementation extending the Java collection framework, I was quite surprised to see that the collection interface contains methods declared as optional. The implementer is expected ...
3
votes
1answer
272 views

Apache Wave API

I'd like to create an application based around Apache Wave. Where can I learn more about working with Apache Wave and/or the API for a locally running instance? At the moment, the extent of what I ...
1
vote
7answers
3k views

What is the best way to remember Java APIs? [duplicate]

I have been doing Java for nearly a year now and I have difficulty remembering Java APIs and method names. What is the best way to remember them?
4
votes
2answers
698 views

What are the best patterns/designs for stateful API development?

I am about to implement a API for my TCP/IP server written in Java. Right now I have a temporary method that takes a String, executes a command based on the String and returns a String basically like ...
11
votes
6answers
4k views

Are Java's public fields just a tragic historical design flaw at this point? [closed]

It seems to be Java orthodoxy at this point that one should basically never use public fields for object state. (I don't necessarily agree, but that's not relevant to my question.) Given that, would ...
3
votes
1answer
135 views

Legal aspects of Java specification implementations in other programming languages

I am planning to implement an official Java specification in a different programming language. Would this be a copyright violation? Hypothetical examples: a JMX "wrapper" library for C++ which can ...
7
votes
8answers
795 views

Examples of Java APIs that demand an action sequence

As part of a research I'm working on, I'm looking for public APIs that only work correctly when you apply a certain sequence of actions on them. For example, the java.nio.channels.SocketChannel ...